1 ; RUN: llc < %s -mtriple=i386-unknown-linux-gnu | FileCheck %s -check-prefix=LINUX
2 ; RUN: llc < %s -mtriple=i386-apple-darwin9.7 | FileCheck %s -check-prefix=DARWIN
6 @G1 = common global i32 0
8 ; LINUX: .type G1,@object
9 ; LINUX: .section .gnu.linkonce.b.G1,"aw",@nobits
12 ; DARWIN: .comm _G1,4,2
17 ; const int G2 __attribute__((weak)) = 42;
18 @G2 = weak_odr constant i32 42
21 ; TODO: linux drops this into .rodata, we drop it into ".gnu.linkonce.r.G2"
23 ; DARWIN: .section __TEXT,__const_coal,coalesced
28 ; int * const G3 = &G1;
29 @G3 = constant i32* @G1
31 ; DARWIN: .section __DATA,__const
37 ; _Complex long long const G4 = 34;
38 @G4 = constant {i64,i64} { i64 34, i64 0 }
40 ; DARWIN: .section __TEXT,__const
53 ; DARWIN: .section __DATA,__data
60 @"foo bar" = linkonce global i32 42
62 ; LINUX: .type foo_20_bar,@object
63 ; LINUX:.section .gnu.linkonce.d.foo_20_bar,"aw",@progbits
64 ; LINUX: .weak foo_20_bar
67 ; DARWIN: .section __DATA,__datacoal_nt,coalesced
68 ; DARWIN: .globl "_foo bar"
69 ; DARWIN: .weak_definition "_foo bar"
73 @G6 = weak_odr constant [1 x i8] c"\01"
75 ; LINUX: .type G6,@object
76 ; LINUX: .section .gnu.linkonce.r.G6,"a",@progbits
79 ; LINUX: .ascii "\001"
82 ; DARWIN: .section __TEXT,__const_coal,coalesced
84 ; DARWIN: .weak_definition _G6
86 ; DARWIN: .ascii "\001"
89 @G7 = constant [10 x i8] c"abcdefghi\00"
91 ; DARWIN: __TEXT,__cstring,cstring_literals
94 ; DARWIN: .asciz "abcdefghi"
96 ; LINUX: .section .rodata.str1.1,"aMS",@progbits,1
99 ; LINUX: .asciz "abcdefghi"
102 @G8 = constant [4 x i16] [ i16 1, i16 2, i16 3, i16 0 ]
104 ; DARWIN: .section __TEXT,__ustring
108 ; LINUX: .section .rodata.str2.2,"aMS",@progbits,2
112 @G9 = constant [4 x i32] [ i32 1, i32 2, i32 3, i32 0 ]
114 ; DARWIN: .section __TEXT,__const
118 ; LINUX: .section .rodata.str4.4,"aMS",@progbits,4