summaryrefslogtreecommitdiff
path: root/test/LTO
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2017-11-21 22:06:20 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2017-11-21 22:06:20 +0000
commit93e2dfd1c08c9ab56c90bf2e438eb58495b4240f (patch)
treee0d3ecd786a5e407e64a87cfa2cbb1e8420a0ca3 /test/LTO
parent8304ff28f11a76ac7f92bda8db9061835139bebc (diff)
Object: Improve COFF irsymtab comdat representation.
Change the representation of COFF comdats so that a COFF linker is able to accurately resolve comdats between IR and native object files. Specifically, apply name mangling to comdat names consistently with native object files, and do not export comdats with an internal leader because they do not affect symbol resolution. Differential Revision: https://reviews.llvm.org/D40278 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318805 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/LTO')
-rw-r--r--test/LTO/Resolution/X86/symtab.ll25
1 files changed, 21 insertions, 4 deletions
diff --git a/test/LTO/Resolution/X86/symtab.ll b/test/LTO/Resolution/X86/symtab.ll
index fecea0a1e7b..c43494a5b7e 100644
--- a/test/LTO/Resolution/X86/symtab.ll
+++ b/test/LTO/Resolution/X86/symtab.ll
@@ -17,6 +17,15 @@ define i32 @fun() {
ret i32 0
}
+; CHECK: D------X @fun2@8
+; CHECK-NEXT: comdat @fun2@8
+$fun2 = comdat any
+define x86_fastcallcc i32 @fun2(i32 inreg %a, i32 inreg %b) comdat {
+entry:
+ %add = add nsw i32 %b, %a
+ ret i32 %add
+}
+
; CHECK: H------- _g1
@g1 = hidden global i32 0
@@ -43,11 +52,19 @@ define i32 @fun() {
@g8 = common global i32 0, align 8
; CHECK: D------- _g9
-; CHECK-NEXT: comdat g9
+; CHECK-NEXT: comdat _g9
$g9 = comdat any
@g9 = global i32 0, comdat
-; CHECK: D--WI--- _g10
-; CHECK-NEXT: comdat g9
+; CHECK-NOT: _g10
+$g10 = comdat any
+@g10 = internal global i32 0, comdat
+
+; CHECK: D------- _g11
+; CHECK-NOT: comdat
+@g11 = global i32 0, comdat($g10)
+
+; CHECK: D--WI--- _a1
+; CHECK-NEXT: comdat _g9
; CHECK-NEXT: fallback _g9
-@g10 = weak alias i32, i32* @g9
+@a1 = weak alias i32, i32* @g9