2009-09-09 07:54:48 +08:00
|
|
|
; RUN: llc < %s -mtriple=i386-unknown-linux-gnu | FileCheck %s -check-prefix=LINUX
|
|
|
|
; RUN: llc < %s -mtriple=i386-apple-darwin9.7 | FileCheck %s -check-prefix=DARWIN
|
2009-07-26 01:57:37 +08:00
|
|
|
|
2009-07-26 08:51:36 +08:00
|
|
|
|
|
|
|
; int G1;
|
2009-07-26 01:57:37 +08:00
|
|
|
@G1 = common global i32 0
|
|
|
|
|
|
|
|
; LINUX: .type G1,@object
|
|
|
|
; LINUX: .section .gnu.linkonce.b.G1,"aw",@nobits
|
|
|
|
; LINUX: .comm G1,4,4
|
|
|
|
|
2009-07-26 08:51:36 +08:00
|
|
|
; DARWIN: .comm _G1,4,2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; const int G2 __attribute__((weak)) = 42;
|
|
|
|
@G2 = weak_odr constant i32 42
|
|
|
|
|
|
|
|
|
|
|
|
; TODO: linux drops this into .rodata, we drop it into ".gnu.linkonce.r.G2"
|
|
|
|
|
|
|
|
; DARWIN: .section __TEXT,__const_coal,coalesced
|
|
|
|
; DARWIN: _G2:
|
|
|
|
; DARWIN: .long 42
|
2009-07-26 09:24:18 +08:00
|
|
|
|
|
|
|
|
|
|
|
; int * const G3 = &G1;
|
|
|
|
@G3 = constant i32* @G1
|
|
|
|
|
2009-08-10 09:39:42 +08:00
|
|
|
; DARWIN: .section __DATA,__const
|
2009-07-26 09:24:18 +08:00
|
|
|
; DARWIN: .globl _G3
|
|
|
|
; DARWIN: _G3:
|
|
|
|
; DARWIN: .long _G1
|
|
|
|
|
|
|
|
|
|
|
|
; _Complex long long const G4 = 34;
|
|
|
|
@G4 = constant {i64,i64} { i64 34, i64 0 }
|
|
|
|
|
2009-08-10 09:39:42 +08:00
|
|
|
; DARWIN: .section __TEXT,__const
|
2009-07-26 09:24:18 +08:00
|
|
|
; DARWIN: _G4:
|
2009-07-26 11:06:11 +08:00
|
|
|
; DARWIN: .long 34
|
|
|
|
|
|
|
|
|
|
|
|
; int G5 = 47;
|
|
|
|
@G5 = global i32 47
|
|
|
|
|
|
|
|
; LINUX: .data
|
|
|
|
; LINUX: .globl G5
|
|
|
|
; LINUX: G5:
|
|
|
|
; LINUX: .long 47
|
|
|
|
|
2009-08-10 09:39:42 +08:00
|
|
|
; DARWIN: .section __DATA,__data
|
2009-07-26 11:06:11 +08:00
|
|
|
; DARWIN: .globl _G5
|
|
|
|
; DARWIN: _G5:
|
|
|
|
; DARWIN: .long 47
|
|
|
|
|
2009-07-29 13:20:33 +08:00
|
|
|
|
|
|
|
; PR4584
|
|
|
|
@"foo bar" = linkonce global i32 42
|
|
|
|
|
|
|
|
; LINUX: .type foo_20_bar,@object
|
|
|
|
; LINUX:.section .gnu.linkonce.d.foo_20_bar,"aw",@progbits
|
|
|
|
; LINUX: .weak foo_20_bar
|
|
|
|
; LINUX: foo_20_bar:
|
|
|
|
|
|
|
|
; DARWIN: .section __DATA,__datacoal_nt,coalesced
|
|
|
|
; DARWIN: .globl "_foo bar"
|
|
|
|
; DARWIN: .weak_definition "_foo bar"
|
|
|
|
; DARWIN: "_foo bar":
|
2009-08-01 00:17:13 +08:00
|
|
|
|
|
|
|
; PR4650
|
|
|
|
@G6 = weak_odr constant [1 x i8] c"\01"
|
|
|
|
|
|
|
|
; LINUX: .type G6,@object
|
|
|
|
; LINUX: .section .gnu.linkonce.r.G6,"a",@progbits
|
|
|
|
; LINUX: .weak G6
|
2009-08-13 09:36:44 +08:00
|
|
|
; LINUX: G6:
|
2009-08-01 00:17:13 +08:00
|
|
|
; LINUX: .ascii "\001"
|
2009-08-13 09:36:44 +08:00
|
|
|
; LINUX: .size G6, 1
|
2009-08-01 00:17:13 +08:00
|
|
|
|
|
|
|
; DARWIN: .section __TEXT,__const_coal,coalesced
|
|
|
|
; DARWIN: .globl _G6
|
|
|
|
; DARWIN: .weak_definition _G6
|
|
|
|
; DARWIN:_G6:
|
|
|
|
; DARWIN: .ascii "\001"
|
|
|
|
|
2009-08-05 00:13:09 +08:00
|
|
|
|
|
|
|
@G7 = constant [10 x i8] c"abcdefghi\00"
|
|
|
|
|
2009-08-10 09:39:42 +08:00
|
|
|
; DARWIN: __TEXT,__cstring,cstring_literals
|
2009-08-05 00:13:09 +08:00
|
|
|
; DARWIN: .globl _G7
|
|
|
|
; DARWIN: _G7:
|
|
|
|
; DARWIN: .asciz "abcdefghi"
|
|
|
|
|
|
|
|
; LINUX: .section .rodata.str1.1,"aMS",@progbits,1
|
|
|
|
; LINUX: .globl G7
|
|
|
|
; LINUX: G7:
|
|
|
|
; LINUX: .asciz "abcdefghi"
|
|
|
|
|
|
|
|
|
|
|
|
@G8 = constant [4 x i16] [ i16 1, i16 2, i16 3, i16 0 ]
|
|
|
|
|
2009-08-05 00:27:13 +08:00
|
|
|
; DARWIN: .section __TEXT,__ustring
|
2009-08-05 00:13:09 +08:00
|
|
|
; DARWIN: .globl _G8
|
|
|
|
; DARWIN: _G8:
|
|
|
|
|
|
|
|
; LINUX: .section .rodata.str2.2,"aMS",@progbits,2
|
|
|
|
; LINUX: .globl G8
|
|
|
|
; LINUX:G8:
|
|
|
|
|
|
|
|
@G9 = constant [4 x i32] [ i32 1, i32 2, i32 3, i32 0 ]
|
|
|
|
|
2009-08-10 09:39:42 +08:00
|
|
|
; DARWIN: .section __TEXT,__const
|
2009-08-05 00:13:09 +08:00
|
|
|
; DARWIN: .globl _G9
|
|
|
|
; DARWIN: _G9:
|
|
|
|
|
|
|
|
; LINUX: .section .rodata.str4.4,"aMS",@progbits,4
|
|
|
|
; LINUX: .globl G9
|
|
|
|
; LINUX:G9
|
|
|
|
|
|
|
|
|
|
|
|
|