summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen
diff options
context:
space:
mode:
authorTimur Iskhodzhanov <timurrrr@google.com>2015-01-16 08:38:45 +0000
committerTimur Iskhodzhanov <timurrrr@google.com>2015-01-16 08:38:45 +0000
commit60b721363c86ef4712aa26652ed6cbcd9768c3f9 (patch)
treecae8ca8d3c34df2ca31636f7d60f6609e9fc5f44 /llvm/test/CodeGen
parent24b04aa393d683404aec0e77a5d3915ed8f65eb0 (diff)
downloadbcm5719-llvm-60b721363c86ef4712aa26652ed6cbcd9768c3f9.tar.gz
bcm5719-llvm-60b721363c86ef4712aa26652ed6cbcd9768c3f9.zip
Revert r226242 - Revert Revert Don't create new comdats in CodeGen
This breaks AddressSanitizer (ninja check-asan) on Windows llvm-svn: 226251
Diffstat (limited to 'llvm/test/CodeGen')
-rw-r--r--llvm/test/CodeGen/ARM/odr_comdat.ll16
-rw-r--r--llvm/test/CodeGen/ARM/section-name.ll2
-rw-r--r--llvm/test/CodeGen/X86/dllexport-x86_64.ll5
-rw-r--r--llvm/test/CodeGen/X86/dllexport.ll5
-rw-r--r--llvm/test/CodeGen/X86/global-sections.ll2
-rw-r--r--llvm/test/CodeGen/X86/odr_comdat.ll16
-rw-r--r--llvm/test/CodeGen/X86/pic_jumptable.ll2
7 files changed, 46 insertions, 2 deletions
diff --git a/llvm/test/CodeGen/ARM/odr_comdat.ll b/llvm/test/CodeGen/ARM/odr_comdat.ll
new file mode 100644
index 00000000000..e28b5788ef6
--- /dev/null
+++ b/llvm/test/CodeGen/ARM/odr_comdat.ll
@@ -0,0 +1,16 @@
+; RUN: llc < %s -mtriple=arm-linux-gnueabi | FileCheck %s -check-prefix=ARMGNUEABI
+
+; Checking that a comdat group gets generated correctly for a static member
+; of instantiated C++ templates.
+; see http://sourcery.mentor.com/public/cxx-abi/abi.html#vague-itemplate
+; section 5.2.6 Instantiated templates
+; "Any static member data object is emitted in a COMDAT identified by its mangled
+; name, in any object file with a reference to its name symbol."
+
+; Case 1: variable is not explicitly initialized, and ends up in a .bss section
+; ARMGNUEABI: .section .bss._ZN1CIiE1iE,"aGw",%nobits,_ZN1CIiE1iE,comdat
+@_ZN1CIiE1iE = weak_odr global i32 0, align 4
+
+; Case 2: variable is explicitly initialized, and ends up in a .data section
+; ARMGNUEABI: .section .data._ZN1CIiE1jE,"aGw",%progbits,_ZN1CIiE1jE,comdat
+@_ZN1CIiE1jE = weak_odr global i32 12, align 4
diff --git a/llvm/test/CodeGen/ARM/section-name.ll b/llvm/test/CodeGen/ARM/section-name.ll
index a4c6054197f..a0aad4733bc 100644
--- a/llvm/test/CodeGen/ARM/section-name.ll
+++ b/llvm/test/CodeGen/ARM/section-name.ll
@@ -16,7 +16,7 @@ entry:
ret void
}
-; CHECK: .text
+; CHECK: .section .text.test3,"axG",%progbits,test3,comdat
; CHECK: .weak test3
; CHECK: .type test3,%function
define linkonce_odr void @test3() {
diff --git a/llvm/test/CodeGen/X86/dllexport-x86_64.ll b/llvm/test/CodeGen/X86/dllexport-x86_64.ll
index 25b88e56e45..c673f5d485f 100644
--- a/llvm/test/CodeGen/X86/dllexport-x86_64.ll
+++ b/llvm/test/CodeGen/X86/dllexport-x86_64.ll
@@ -17,16 +17,19 @@ define dllexport void @f2() unnamed_addr {
ret void
}
+; CHECK: .section .text,"xr",discard,lnk1
; CHECK: .globl lnk1
define linkonce_odr dllexport void @lnk1() {
ret void
}
+; CHECK: .section .text,"xr",discard,lnk2
; CHECK: .globl lnk2
define linkonce_odr dllexport void @lnk2() alwaysinline {
ret void
}
+; CHECK: .section .text,"xr",discard,weak1
; CHECK: .globl weak1
define weak_odr dllexport void @weak1() {
ret void
@@ -44,9 +47,11 @@ define weak_odr dllexport void @weak1() {
; CHECK: .comm Var3
@Var3 = common dllexport global i32 0, align 4
+; CHECK: .section .data,"wd",discard,WeakVar1
; CHECK: .globl WeakVar1
@WeakVar1 = weak_odr dllexport global i32 1, align 4
+; CHECK: .section .rdata,"rd",discard,WeakVar2
; CHECK: .globl WeakVar2
@WeakVar2 = weak_odr dllexport unnamed_addr constant i32 1
diff --git a/llvm/test/CodeGen/X86/dllexport.ll b/llvm/test/CodeGen/X86/dllexport.ll
index e76591d7f5e..5035aa15330 100644
--- a/llvm/test/CodeGen/X86/dllexport.ll
+++ b/llvm/test/CodeGen/X86/dllexport.ll
@@ -36,16 +36,19 @@ define dllexport x86_thiscallcc void @thisfun() nounwind {
ret void
}
+; CHECK: .section .text,"xr",discard,_lnk1
; CHECK: .globl _lnk1
define linkonce_odr dllexport void @lnk1() {
ret void
}
+; CHECK: .section .text,"xr",discard,_lnk2
; CHECK: .globl _lnk2
define linkonce_odr dllexport void @lnk2() alwaysinline {
ret void
}
+; CHECK: .section .text,"xr",discard,_weak1
; CHECK: .globl _weak1
define weak_odr dllexport void @weak1() {
ret void
@@ -63,9 +66,11 @@ define weak_odr dllexport void @weak1() {
; CHECK: .comm _Var3
@Var3 = common dllexport global i32 0, align 4
+; CHECK: .section .data,"wd",discard,_WeakVar1
; CHECK: .globl _WeakVar1
@WeakVar1 = weak_odr dllexport global i32 1, align 4
+; CHECK: .section .rdata,"rd",discard,_WeakVar2
; CHECK: .globl _WeakVar2
@WeakVar2 = weak_odr dllexport unnamed_addr constant i32 1
diff --git a/llvm/test/CodeGen/X86/global-sections.ll b/llvm/test/CodeGen/X86/global-sections.ll
index 24be27161f4..fa1169d8a8e 100644
--- a/llvm/test/CodeGen/X86/global-sections.ll
+++ b/llvm/test/CodeGen/X86/global-sections.ll
@@ -85,6 +85,7 @@ define void @F1() {
@"foo bar" = linkonce global i32 42
; LINUX: .type "foo bar",@object
+; LINUX: .section ".data.foo bar","aGw",@progbits,"foo bar",comdat
; LINUX: .weak "foo bar"
; LINUX: "foo bar":
@@ -97,6 +98,7 @@ define void @F1() {
@G6 = weak_odr unnamed_addr constant [1 x i8] c"\01"
; LINUX: .type G6,@object
+; LINUX: .section .rodata.G6,"aG",@progbits,G6,comdat
; LINUX: .weak G6
; LINUX: G6:
; LINUX: .byte 1
diff --git a/llvm/test/CodeGen/X86/odr_comdat.ll b/llvm/test/CodeGen/X86/odr_comdat.ll
new file mode 100644
index 00000000000..547334c045a
--- /dev/null
+++ b/llvm/test/CodeGen/X86/odr_comdat.ll
@@ -0,0 +1,16 @@
+; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu | FileCheck %s -check-prefix=X86LINUX
+
+; Checking that a comdat group gets generated correctly for a static member
+; of instantiated C++ templates.
+; see http://sourcery.mentor.com/public/cxx-abi/abi.html#vague-itemplate
+; section 5.2.6 Instantiated templates
+; "Any static member data object is emitted in a COMDAT identified by its mangled
+; name, in any object file with a reference to its name symbol."
+
+; Case 1: variable is not explicitly initialized, and ends up in a .bss section
+; X86LINUX: .section .bss._ZN1CIiE1iE,"aGw",@nobits,_ZN1CIiE1iE,comdat
+@_ZN1CIiE1iE = weak_odr global i32 0, align 4
+
+; Case 2: variable is explicitly initialized, and ends up in a .data section
+; X86LINUX: .section .data._ZN1CIiE1jE,"aGw",@progbits,_ZN1CIiE1jE,comdat
+@_ZN1CIiE1jE = weak_odr global i32 12, align 4
diff --git a/llvm/test/CodeGen/X86/pic_jumptable.ll b/llvm/test/CodeGen/X86/pic_jumptable.ll
index d66ff0c59db..bdd88593584 100644
--- a/llvm/test/CodeGen/X86/pic_jumptable.ll
+++ b/llvm/test/CodeGen/X86/pic_jumptable.ll
@@ -10,7 +10,7 @@
declare void @_Z3bari(i32)
-; CHECK-LINUX: _Z3fooILi1EEvi:
+; CHECK-LINUX: .text._Z3fooILi1EEvi,"axG",@progbits,_Z3fooILi1EEvi,comdat
define linkonce void @_Z3fooILi1EEvi(i32 %Y) nounwind {
entry:
; CHECK: L0$pb
OpenPOWER on IntegriCloud