summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-07-26 00:51:36 +0000
committerChris Lattner <sabre@nondot.org>2009-07-26 00:51:36 +0000
commite3577da6d969c7411736b5fcfe27ba355dd2d806 (patch)
tree2ce0c83282ecf1694dd0db43fb8c7c4a78fc0725 /test
parentd60123983380532979c7ca5eef072c74b3185704 (diff)
downloadllvm-e3577da6d969c7411736b5fcfe27ba355dd2d806.tar.gz
llvm-e3577da6d969c7411736b5fcfe27ba355dd2d806.tar.bz2
llvm-e3577da6d969c7411736b5fcfe27ba355dd2d806.tar.xz
simplify DarwinTargetAsmInfo::SelectSectionForGlobal a bit
and make it more aggressive, we now put: const int G2 __attribute__((weak)) = 42; into the text (readonly) segment like gcc, previously we put it into the data (readwrite) segment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77104 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/X86/global-sections.ll17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/CodeGen/X86/global-sections.ll b/test/CodeGen/X86/global-sections.ll
index 0b4ed3b360..ab3c5922e7 100644
--- a/test/CodeGen/X86/global-sections.ll
+++ b/test/CodeGen/X86/global-sections.ll
@@ -1,8 +1,25 @@
; RUN: llvm-as < %s | llc -mtriple=i386-unknown-linux-gnu | FileCheck %s -check-prefix=LINUX
+; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin9.7 | FileCheck %s -check-prefix=DARWIN
+
+; int G1;
@G1 = common global i32 0
; LINUX: .type G1,@object
; LINUX: .section .gnu.linkonce.b.G1,"aw",@nobits
; LINUX: .comm G1,4,4
+; 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