2009-07-26 01:57:37 +08:00
|
|
|
; RUN: llvm-as < %s | llc -mtriple=i386-unknown-linux-gnu | FileCheck %s -check-prefix=LINUX
|
2009-07-26 08:51:36 +08:00
|
|
|
; RUN: llvm-as < %s | llc -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
|
|
|
|
|
|
|
|
; DARWIN: .const_data
|
|
|
|
; DARWIN: .globl _G3
|
|
|
|
; DARWIN: _G3:
|
|
|
|
; DARWIN: .long _G1
|
|
|
|
|
|
|
|
|
|
|
|
; _Complex long long const G4 = 34;
|
|
|
|
@G4 = constant {i64,i64} { i64 34, i64 0 }
|
|
|
|
|
2009-07-29 02:04:18 +08:00
|
|
|
; DARWIN: .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
|
|
|
|
|
|
|
|
; DARWIN: .data
|
|
|
|
; DARWIN: .globl _G5
|
|
|
|
; DARWIN: _G5:
|
|
|
|
; DARWIN: .long 47
|
|
|
|
|