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-GlobalValue metadata. 37@l = global i32 1, section "ccc", !associated !5 38!5 = !{i32* null} 39; CHECK-DAG: .section ccc,"awo",@progbits,0,unique,3 40 41; Null metadata. 42@m = global i32 1, section "ddd", !associated !6 43!6 = distinct !{null} 44; CHECK-DAG: .section ddd,"awo",@progbits,0,unique,4 45 46; Aliases are OK. 47@n = alias i32, i32* inttoptr (i64 add (i64 ptrtoint (i32* @a to i64), i64 1297036692682702848) to i32*) 48@o = global i32 1, section "eee", !associated !7 49!7 = !{i32* @n} 50; CHECK-DAG: .section eee,"awo",@progbits,n,unique,5 51