summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2015-01-14 20:55:48 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2015-01-14 20:55:48 +0000
commitfad1639a12a60735545a4d59a35c82841131a51a (patch)
tree6f75700c5b7772d05bf515f7dc3c9a5df766b428 /llvm/test
parent55f74e829bb173ecc70ed2b83f565add5df4fa7d (diff)
downloadbcm5719-llvm-fad1639a12a60735545a4d59a35c82841131a51a.tar.gz
bcm5719-llvm-fad1639a12a60735545a4d59a35c82841131a51a.zip
Don't create new comdats in CodeGen.
This patch stops the implicit creation of comdats during codegen. Clang now sets the comdat explicitly when it is required. With this patch clang and gcc now produce the same result in pr19848. llvm-svn: 226038
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Bitcode/linkage-types-3.2.ll12
-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
-rw-r--r--llvm/test/MC/COFF/bss_section.ll3
-rw-r--r--llvm/test/MC/COFF/const-gv-with-rel-init.ll2
-rw-r--r--llvm/test/MC/COFF/weak-symbol.ll48
11 files changed, 11 insertions, 102 deletions
diff --git a/llvm/test/Bitcode/linkage-types-3.2.ll b/llvm/test/Bitcode/linkage-types-3.2.ll
index e255b619f41..fb6cc5745fa 100644
--- a/llvm/test/Bitcode/linkage-types-3.2.ll
+++ b/llvm/test/Bitcode/linkage-types-3.2.ll
@@ -33,13 +33,13 @@
; CHECK: @available_externally.var = available_externally constant i32 0{{$}}
@linkonce.var = linkonce constant i32 0
-; CHECK: @linkonce.var = linkonce constant i32 0{{$}}
+; CHECK: @linkonce.var = linkonce constant i32 0, comdat{{$}}
@weak.var = weak constant i32 0
-; CHECK: @weak.var = weak constant i32 0{{$}}
+; CHECK: @weak.var = weak constant i32 0, comdat{{$}}
@linkonce_odr.var = linkonce_odr constant i32 0
-; CHECK: @linkonce_odr.var = linkonce_odr constant i32 0{{$}}
+; CHECK: @linkonce_odr.var = linkonce_odr constant i32 0, comdat{{$}}
@linkonce_odr_auto_hide.var = linkonce_odr_auto_hide constant i32 0
; CHECK: @linkonce_odr_auto_hide.var = constant i32 0{{$}}
@@ -90,19 +90,19 @@ define available_externally void @available_externally()
}
define linkonce void @linkonce()
-; CHECK: define linkonce void @linkonce() {
+; CHECK: define linkonce void @linkonce() comdat {
{
ret void
}
define weak void @weak()
-; CHECK: define weak void @weak() {
+; CHECK: define weak void @weak() comdat {
{
ret void
}
define linkonce_odr void @linkonce_odr()
-; CHECK: define linkonce_odr void @linkonce_odr() {
+; CHECK: define linkonce_odr void @linkonce_odr() comdat {
{
ret void
}
diff --git a/llvm/test/CodeGen/ARM/odr_comdat.ll b/llvm/test/CodeGen/ARM/odr_comdat.ll
deleted file mode 100644
index e28b5788ef6..00000000000
--- a/llvm/test/CodeGen/ARM/odr_comdat.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; 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 a0aad4733bc..a4c6054197f 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: .section .text.test3,"axG",%progbits,test3,comdat
+; CHECK: .text
; 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 c673f5d485f..25b88e56e45 100644
--- a/llvm/test/CodeGen/X86/dllexport-x86_64.ll
+++ b/llvm/test/CodeGen/X86/dllexport-x86_64.ll
@@ -17,19 +17,16 @@ 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
@@ -47,11 +44,9 @@ 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 5035aa15330..e76591d7f5e 100644
--- a/llvm/test/CodeGen/X86/dllexport.ll
+++ b/llvm/test/CodeGen/X86/dllexport.ll
@@ -36,19 +36,16 @@ 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
@@ -66,11 +63,9 @@ 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 fa1169d8a8e..24be27161f4 100644
--- a/llvm/test/CodeGen/X86/global-sections.ll
+++ b/llvm/test/CodeGen/X86/global-sections.ll
@@ -85,7 +85,6 @@ 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":
@@ -98,7 +97,6 @@ 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
deleted file mode 100644
index 547334c045a..00000000000
--- a/llvm/test/CodeGen/X86/odr_comdat.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; 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 bdd88593584..d66ff0c59db 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: .text._Z3fooILi1EEvi,"axG",@progbits,_Z3fooILi1EEvi,comdat
+; CHECK-LINUX: _Z3fooILi1EEvi:
define linkonce void @_Z3fooILi1EEvi(i32 %Y) nounwind {
entry:
; CHECK: L0$pb
diff --git a/llvm/test/MC/COFF/bss_section.ll b/llvm/test/MC/COFF/bss_section.ll
index 1921eeb61a6..f80a0712b7e 100644
--- a/llvm/test/MC/COFF/bss_section.ll
+++ b/llvm/test/MC/COFF/bss_section.ll
@@ -5,5 +5,6 @@
@"\01?thingy@@3Ufoo@@B" = global %struct.foo zeroinitializer, align 4
; CHECK: .bss
-@thingy_linkonce = linkonce_odr global %struct.foo zeroinitializer, align 4
+$thingy_linkonce = comdat any
+@thingy_linkonce = linkonce_odr global %struct.foo zeroinitializer, comdat, align 4
; CHECK: .section .bss,"wb",discard,_thingy_linkonce
diff --git a/llvm/test/MC/COFF/const-gv-with-rel-init.ll b/llvm/test/MC/COFF/const-gv-with-rel-init.ll
index 7d3c5f63188..6a89e2faa68 100644
--- a/llvm/test/MC/COFF/const-gv-with-rel-init.ll
+++ b/llvm/test/MC/COFF/const-gv-with-rel-init.ll
@@ -8,4 +8,4 @@ define void @f() {
; CHECK: .section .CRT$XLB,"rd"
@weak_array = weak_odr unnamed_addr constant [1 x i8*] [i8* bitcast (void ()* @f to i8*)]
-; CHECK: .section .rdata,"rd",discard,weak_array
+; CHECK: .section .rdata,"rd"
diff --git a/llvm/test/MC/COFF/weak-symbol.ll b/llvm/test/MC/COFF/weak-symbol.ll
deleted file mode 100644
index fd78307c1f2..00000000000
--- a/llvm/test/MC/COFF/weak-symbol.ll
+++ /dev/null
@@ -1,48 +0,0 @@
-; Test that weak functions and globals are placed into selectany COMDAT
-; sections with the mangled name as suffix. Ensure that the weak linkage
-; type is not ignored by the backend if the section was specialized.
-;
-; RUN: llc -mtriple=i686-pc-win32 %s -o - | FileCheck %s --check-prefix=X86
-; RUN: llc -mtriple=i686-pc-mingw32 %s -o - | FileCheck %s --check-prefix=X86
-; RUN: llc -mtriple=x86_64-pc-win32 %s -o - | FileCheck %s --check-prefix=X64
-; RUN: llc -mtriple=x86_64-pc-mingw32 %s -o - | FileCheck %s --check-prefix=X64
-
-; Mangled function
-; X86: .section .text,"xr",discard,__Z3foo
-; X86: .globl __Z3foo
-;
-; X64: .section .text,"xr",discard,_Z3foo
-; X64: .globl _Z3foo
-define weak void @_Z3foo() {
- ret void
-}
-
-; Unmangled function
-; X86: .section .sect,"xr",discard,_f
-; X86: .globl _f
-;
-; X64: .section .sect,"xr",discard,f
-; X64: .globl f
-define weak void @f() section ".sect" {
- ret void
-}
-
-; Weak global
-; X86: .section .data,"rd",discard,_a
-; X86: .globl _a
-; X86: .zero 12
-;
-; X64: .section .data,"rd",discard,a
-; X64: .globl a
-; X64: .zero 12
-@a = weak unnamed_addr constant { i32, i32, i32 } { i32 0, i32 0, i32 0}, section ".data"
-
-; X86: .section .tls$,"wd",discard,_b
-; X86: .globl _b
-; X86: .long 0
-;
-; X64: .section .tls$,"wd",discard,b
-; X64: .globl b
-; X64: .long 0
-
-@b = weak_odr thread_local global i32 0, align 4
OpenPOWER on IntegriCloud