• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -data-sections=1 -mtriple x86_64-pc-linux-gnu < %s | FileCheck %s
2; RUN: llc -data-sections=0 -mtriple x86_64-pc-linux-gnu < %s | FileCheck %s
3
4@a = global i32 1
5@b = global i32 2, !associated !0
6!0 = !{i32* @a}
7; CHECK-DAG: .section .data.b,"awo",@progbits,a
8
9; Loop is OK. Also, normally -data-sections=0 would place @c and @d in the same section. !associated prevents that.
10@c = global i32 2, !associated !2
11@d = global i32 2, !associated !1
12!1 = !{i32* @c}
13!2 = !{i32* @d}
14; CHECK-DAG: .section .data.c,"awo",@progbits,d
15; CHECK-DAG: .section .data.d,"awo",@progbits,c
16
17; BSS is OK.
18@e = global i32 0
19@f = global i32 0, !associated !3
20@g = global i32 1, !associated !3
21!3 = !{i32* @e}
22; CHECK-DAG: .section .bss.f,"awo",@nobits,e
23; CHECK-DAG: .section .data.g,"awo",@progbits,e
24
25; Explicit sections.
26@h = global i32 1, section "aaa"
27@i = global i32 1, section "bbb", !associated !4
28@j = global i32 1, section "bbb", !associated !4
29@k = global i32 1, !associated !4
30!4 = !{i32* @h}
31; CHECK-DAG: .section	aaa,"aw",@progbits
32; CHECK-DAG: .section	bbb,"awo",@progbits,h,unique,1
33; CHECK-DAG: .section	bbb,"awo",@progbits,h,unique,2
34; CHECK-DAG: .section	.data.k,"awo",@progbits,h
35
36; Non-GlobalObject metadata.
37@l = global i32 1, section "ccc", !associated !5
38!5 = !{i32* null}
39; CHECK-DAG: .section	ccc,"aw",@progbits
40
41; Null metadata.
42@m = global i32 1, section "ddd", !associated !6
43!6 = distinct !{null}
44; CHECK-DAG: .section	ddd,"aw",@progbits
45