summaryrefslogtreecommitdiff
path: root/test/LTO/Resolution/X86
diff options
context:
space:
mode:
Diffstat (limited to 'test/LTO/Resolution/X86')
-rw-r--r--test/LTO/Resolution/X86/Inputs/link-odr-availextern-ae.ll6
-rw-r--r--test/LTO/Resolution/X86/Inputs/link-odr-availextern-odr.ll6
-rw-r--r--test/LTO/Resolution/X86/alias.ll2
-rw-r--r--test/LTO/Resolution/X86/asm-output.ll19
-rw-r--r--test/LTO/Resolution/X86/comdat.ll2
-rw-r--r--test/LTO/Resolution/X86/common2.ll16
-rw-r--r--test/LTO/Resolution/X86/commons.ll2
-rw-r--r--test/LTO/Resolution/X86/diagnostic-handler-remarks-with-hotness.ll37
-rw-r--r--test/LTO/Resolution/X86/diagnostic-handler-remarks.ll33
-rw-r--r--test/LTO/Resolution/X86/empty-bitcode.test2
-rw-r--r--test/LTO/Resolution/X86/intrinsic.ll2
-rw-r--r--test/LTO/Resolution/X86/link-odr-availextern.ll38
-rw-r--r--test/LTO/Resolution/X86/lowertypetests.ll21
-rw-r--r--test/LTO/Resolution/X86/mixed_lto.ll4
-rw-r--r--test/LTO/Resolution/X86/multi-thinlto.ll2
-rw-r--r--test/LTO/Resolution/X86/symtab-elf.ll15
-rw-r--r--test/LTO/Resolution/X86/symtab.ll53
17 files changed, 244 insertions, 16 deletions
diff --git a/test/LTO/Resolution/X86/Inputs/link-odr-availextern-ae.ll b/test/LTO/Resolution/X86/Inputs/link-odr-availextern-ae.ll
new file mode 100644
index 0000000000000..f2d180afc82de
--- /dev/null
+++ b/test/LTO/Resolution/X86/Inputs/link-odr-availextern-ae.ll
@@ -0,0 +1,6 @@
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+define available_externally i32 @f() {
+ ret i32 2
+}
diff --git a/test/LTO/Resolution/X86/Inputs/link-odr-availextern-odr.ll b/test/LTO/Resolution/X86/Inputs/link-odr-availextern-odr.ll
new file mode 100644
index 0000000000000..76e745a444fed
--- /dev/null
+++ b/test/LTO/Resolution/X86/Inputs/link-odr-availextern-odr.ll
@@ -0,0 +1,6 @@
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+define linkonce_odr i32 @f() {
+ ret i32 2
+}
diff --git a/test/LTO/Resolution/X86/alias.ll b/test/LTO/Resolution/X86/alias.ll
index 2056112e145da..886eadcfc82e2 100644
--- a/test/LTO/Resolution/X86/alias.ll
+++ b/test/LTO/Resolution/X86/alias.ll
@@ -1,6 +1,6 @@
; RUN: llvm-as %s -o %t1.o
; RUN: llvm-as %p/Inputs/alias-1.ll -o %t2.o
-; RUN: llvm-lto2 -o %t3.o %t2.o %t1.o -r %t2.o,a,px -r %t1.o,a, -r %t1.o,b,px -save-temps
+; RUN: llvm-lto2 run -o %t3.o %t2.o %t1.o -r %t2.o,a,px -r %t1.o,a, -r %t1.o,b,px -save-temps
; RUN: llvm-dis < %t3.o.0.0.preopt.bc -o - | FileCheck %s
; RUN: FileCheck --check-prefix=RES %s < %t3.o.resolution.txt
diff --git a/test/LTO/Resolution/X86/asm-output.ll b/test/LTO/Resolution/X86/asm-output.ll
new file mode 100644
index 0000000000000..41d293501dd10
--- /dev/null
+++ b/test/LTO/Resolution/X86/asm-output.ll
@@ -0,0 +1,19 @@
+; Test the ability to emit assembly code from the resolution-based LTO API
+;
+; RUN: llvm-as < %s > %t1.bc
+;
+; RUN: llvm-lto2 run -filetype=asm -r %t1.bc,main,px -o %t2 %t1.bc
+; RUN: FileCheck --check-prefix=ASM %s < %t2.0
+; RUN: llvm-lto2 run -filetype=obj -r %t1.bc,main,px -o %t2 %t1.bc
+; RUN: llvm-objdump -d %t2.0 | FileCheck --check-prefix=ASM %s
+;
+; ASM: main:
+
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+define i32 @main() {
+entry:
+ ret i32 23
+}
+
diff --git a/test/LTO/Resolution/X86/comdat.ll b/test/LTO/Resolution/X86/comdat.ll
index 5124b951bed47..60d082b3e0f78 100644
--- a/test/LTO/Resolution/X86/comdat.ll
+++ b/test/LTO/Resolution/X86/comdat.ll
@@ -1,6 +1,6 @@
; RUN: llvm-as %s -o %t.o
; RUN: llvm-as %p/Inputs/comdat.ll -o %t2.o
-; RUN: llvm-lto2 -save-temps -o %t3.o %t.o %t2.o \
+; RUN: llvm-lto2 run -save-temps -o %t3.o %t.o %t2.o \
; RUN: -r=%t.o,f1,plx \
; RUN: -r=%t.o,v1,px \
; RUN: -r=%t.o,r11,px \
diff --git a/test/LTO/Resolution/X86/common2.ll b/test/LTO/Resolution/X86/common2.ll
index 3328d7c5ec367..3cb0a992d9ac3 100644
--- a/test/LTO/Resolution/X86/common2.ll
+++ b/test/LTO/Resolution/X86/common2.ll
@@ -4,7 +4,7 @@
; Test that the common merging (size + alignment) is properly handled
; Client marked the "large with little alignment" one as prevailing
-; RUN: llvm-lto2 %t1.bc %t2.bc -o %t.o -save-temps \
+; RUN: llvm-lto2 run %t1.bc %t2.bc -o %t.o -save-temps \
; RUN: -r %t1.bc,v,x \
; RUN: -r %t2.bc,v,px \
; RUN: -r %t1.bc,foo,px \
@@ -12,7 +12,7 @@
; RUN: llvm-dis < %t.o.0.0.preopt.bc | FileCheck %s --check-prefix=LARGE-PREVAILED
; Same as before, but reversing the order of the inputs
-; RUN: llvm-lto2 %t2.bc %t1.bc -o %t.o -save-temps \
+; RUN: llvm-lto2 run %t2.bc %t1.bc -o %t.o -save-temps \
; RUN: -r %t1.bc,v,x \
; RUN: -r %t2.bc,v,px \
; RUN: -r %t1.bc,foo,px \
@@ -20,7 +20,7 @@
; RUN: llvm-dis < %t.o.0.0.preopt.bc | FileCheck %s --check-prefix=LARGE-PREVAILED
; Client marked the "small with large alignment" one as prevailing
-; RUN: llvm-lto2 %t1.bc %t2.bc -o %t.o -save-temps \
+; RUN: llvm-lto2 run %t1.bc %t2.bc -o %t.o -save-temps \
; RUN: -r %t1.bc,v,px \
; RUN: -r %t2.bc,v,x \
; RUN: -r %t1.bc,foo,px \
@@ -28,7 +28,7 @@
; RUN: llvm-dis < %t.o.0.0.preopt.bc | FileCheck %s --check-prefix=SMALL-PREVAILED
; Same as before, but reversing the order of the inputs
-; RUN: llvm-lto2 %t2.bc %t1.bc -o %t.o -save-temps \
+; RUN: llvm-lto2 run %t2.bc %t1.bc -o %t.o -save-temps \
; RUN: -r %t1.bc,v,px \
; RUN: -r %t2.bc,v,x \
; RUN: -r %t1.bc,foo,px \
@@ -37,7 +37,7 @@
; Client didn't mark any as prevailing, we keep the first one we see as "external"
-; RUN: llvm-lto2 %t1.bc %t2.bc -o %t.o -save-temps \
+; RUN: llvm-lto2 run %t1.bc %t2.bc -o %t.o -save-temps \
; RUN: -r %t1.bc,v,x \
; RUN: -r %t2.bc,v,x \
; RUN: -r %t1.bc,foo,px \
@@ -45,7 +45,7 @@
; RUN: llvm-dis < %t.o.0.0.preopt.bc | FileCheck %s --check-prefix=NONE-PREVAILED1
; Same as before, but reversing the order of the inputs
-; RUN: llvm-lto2 %t2.bc %t1.bc -o %t.o -save-temps \
+; RUN: llvm-lto2 run %t2.bc %t1.bc -o %t.o -save-temps \
; RUN: -r %t1.bc,v,x \
; RUN: -r %t2.bc,v,x \
; RUN: -r %t1.bc,foo,px \
@@ -55,7 +55,7 @@
; Client marked both as prevailing
-; RUN: llvm-lto2 %t1.bc %t2.bc -o %t.o -save-temps \
+; RUN: llvm-lto2 run %t1.bc %t2.bc -o %t.o -save-temps \
; RUN: -r %t1.bc,v,px \
; RUN: -r %t2.bc,v,px \
; RUN: -r %t1.bc,foo,px \
@@ -63,7 +63,7 @@
; RUN: llvm-dis < %t.o.0.0.preopt.bc | FileCheck %s --check-prefix=BOTH-PREVAILED1
; Same as before, but reversing the order of the inputs
-; RUN: llvm-lto2 %t2.bc %t1.bc -o %t.o -save-temps \
+; RUN: llvm-lto2 run %t2.bc %t1.bc -o %t.o -save-temps \
; RUN: -r %t1.bc,v,px \
; RUN: -r %t2.bc,v,px \
; RUN: -r %t1.bc,foo,px \
diff --git a/test/LTO/Resolution/X86/commons.ll b/test/LTO/Resolution/X86/commons.ll
index b3e504835afbd..28bf1ada4a862 100644
--- a/test/LTO/Resolution/X86/commons.ll
+++ b/test/LTO/Resolution/X86/commons.ll
@@ -1,6 +1,6 @@
; RUN: llvm-as -o %t1.bc %s
; RUN: llvm-as -o %t2.bc %p/Inputs/commons.ll
-; RUN: llvm-lto2 %t1.bc -r=%t1.bc,x,l %t2.bc -r=%t2.bc,x,pl -o %t.out -save-temps
+; RUN: llvm-lto2 run %t1.bc -r=%t1.bc,x,l %t2.bc -r=%t2.bc,x,pl -o %t.out -save-temps
; RUN: llvm-dis -o - %t.out.0.0.preopt.bc | FileCheck %s
; A strong definition should override the common
diff --git a/test/LTO/Resolution/X86/diagnostic-handler-remarks-with-hotness.ll b/test/LTO/Resolution/X86/diagnostic-handler-remarks-with-hotness.ll
new file mode 100644
index 0000000000000..2469570c26b30
--- /dev/null
+++ b/test/LTO/Resolution/X86/diagnostic-handler-remarks-with-hotness.ll
@@ -0,0 +1,37 @@
+; RUN: llvm-as < %s >%t.bc
+
+; RUN: rm -f %t.yaml
+; RUN: llvm-lto2 run -pass-remarks-output=%t.yaml \
+; RUN: -pass-remarks-with-hotness \
+; RUN: -r %t.bc,tinkywinky,p \
+; RUN: -r %t.bc,patatino,px \
+; RUN: -r %t.bc,main,px -o %t.o %t.bc
+; RUN: cat %t.yaml | FileCheck %s -check-prefix=YAML
+
+; YAML: --- !Passed
+; YAML-NEXT: Pass: inline
+; YAML-NEXT: Name: Inlined
+; YAML-NEXT: Function: main
+; YAML-NEXT: Hotness: 300
+; YAML-NEXT: Args:
+; YAML-NEXT: - Callee: tinkywinky
+; YAML-NEXT: - String: ' inlined into '
+; YAML-NEXT: - Caller: main
+; YAML-NEXT: ...
+
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-scei-ps4"
+
+declare i32 @patatino()
+
+define i32 @tinkywinky() {
+ %a = call i32 @patatino()
+ ret i32 %a
+}
+
+define i32 @main() !prof !0 {
+ %i = call i32 @tinkywinky()
+ ret i32 %i
+}
+
+!0 = !{!"function_entry_count", i64 300}
diff --git a/test/LTO/Resolution/X86/diagnostic-handler-remarks.ll b/test/LTO/Resolution/X86/diagnostic-handler-remarks.ll
new file mode 100644
index 0000000000000..eb1bca3670c62
--- /dev/null
+++ b/test/LTO/Resolution/X86/diagnostic-handler-remarks.ll
@@ -0,0 +1,33 @@
+; RUN: llvm-as < %s >%t.bc
+
+; RUN: rm -f %t.yaml
+; RUN: llvm-lto2 run -pass-remarks-output=%t.yaml \
+; RUN: -r %t.bc,tinkywinky,p \
+; RUN: -r %t.bc,patatino,px \
+; RUN: -r %t.bc,main,px -o %t.o %t.bc
+; RUN: cat %t.yaml | FileCheck %s -check-prefix=YAML
+
+; YAML: --- !Passed
+; YAML-NEXT: Pass: inline
+; YAML-NEXT: Name: Inlined
+; YAML-NEXT: Function: main
+; YAML-NEXT: Args:
+; YAML-NEXT: - Callee: tinkywinky
+; YAML-NEXT: - String: ' inlined into '
+; YAML-NEXT: - Caller: main
+; YAML-NEXT: ...
+
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-scei-ps4"
+
+declare i32 @patatino()
+
+define i32 @tinkywinky() {
+ %a = call i32 @patatino()
+ ret i32 %a
+}
+
+define i32 @main() {
+ %i = call i32 @tinkywinky()
+ ret i32 %i
+}
diff --git a/test/LTO/Resolution/X86/empty-bitcode.test b/test/LTO/Resolution/X86/empty-bitcode.test
index c98c54499ef6d..c05c5e3824b6b 100644
--- a/test/LTO/Resolution/X86/empty-bitcode.test
+++ b/test/LTO/Resolution/X86/empty-bitcode.test
@@ -1,3 +1,3 @@
RUN: llvm-cat -o %t.o
-RUN: not llvm-lto2 -o %t2 %t.o 2>&1 | FileCheck %s
+RUN: not llvm-lto2 run -o %t2 %t.o 2>&1 | FileCheck %s
CHECK: Bitcode file does not contain any modules
diff --git a/test/LTO/Resolution/X86/intrinsic.ll b/test/LTO/Resolution/X86/intrinsic.ll
index f785f8f4f7149..dc287ace0f879 100644
--- a/test/LTO/Resolution/X86/intrinsic.ll
+++ b/test/LTO/Resolution/X86/intrinsic.ll
@@ -1,6 +1,6 @@
; RUN: llvm-as %s -o %t1.o
; RUN: llvm-as %p/Inputs/intrinsic.ll -o %t2.o
-; RUN: llvm-lto2 -o %t3.o %t1.o %t2.o -r %t1.o,foo
+; RUN: llvm-lto2 run -o %t3.o %t1.o %t2.o -r %t1.o,foo
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
diff --git a/test/LTO/Resolution/X86/link-odr-availextern.ll b/test/LTO/Resolution/X86/link-odr-availextern.ll
new file mode 100644
index 0000000000000..cc360338d6d1d
--- /dev/null
+++ b/test/LTO/Resolution/X86/link-odr-availextern.ll
@@ -0,0 +1,38 @@
+; Tests for correct behavior for non-prevailing resolutions in cases involving
+; *_odr and available_externally linkages.
+
+; RUN: llvm-as %s -o %t1
+; RUN: llvm-as %S/Inputs/link-odr-availextern-ae.ll -o %t2ae
+; RUN: llvm-as %S/Inputs/link-odr-availextern-odr.ll -o %t2odr
+
+; RUN: llvm-lto2 run -o %t3 %t1 %t2ae -r %t1,f,p -r %t2ae,f, -save-temps
+; RUN: llvm-dis < %t3.0.0.preopt.bc -o - | FileCheck --check-prefix=PREVAILING %s
+
+; RUN: llvm-lto2 run -o %t3 %t1 %t2odr -r %t1,f,p -r %t2odr,f, -save-temps
+; RUN: llvm-dis < %t3.0.0.preopt.bc -o - | FileCheck --check-prefix=PREVAILING %s
+
+; RUN: llvm-lto2 run -o %t3 %t2ae %t1 -r %t1,f,p -r %t2ae,f, -save-temps
+; RUN: llvm-dis < %t3.0.0.preopt.bc -o - | FileCheck --check-prefix=PREVAILING %s
+
+; RUN: llvm-lto2 run -o %t3 %t2odr %t1 -r %t1,f,p -r %t2odr,f, -save-temps
+; RUN: llvm-dis < %t3.0.0.preopt.bc -o - | FileCheck --check-prefix=PREVAILING %s
+
+; RUN: llvm-lto2 run -o %t3 %t2ae -r %t2ae,f, -save-temps
+; RUN: llvm-dis < %t3.0.0.preopt.bc -o - | FileCheck --check-prefix=NONPREVAILING %s
+
+; RUN: llvm-lto2 run -o %t3 %t2odr -r %t2odr,f, -save-temps
+; RUN: llvm-dis < %t3.0.0.preopt.bc -o - | FileCheck --check-prefix=NONPREVAILING %s
+
+; RUN: llvm-lto2 run -o %t3 %t2odr %t1 -r %t1,f, -r %t2odr,f, -save-temps
+; RUN: llvm-dis < %t3.0.0.preopt.bc -o - | FileCheck --check-prefix=NONPREVAILING %s
+
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+; PREVAILING: define weak_odr i32 @f()
+; PREVAILING-NEXT: ret i32 1
+; NONPREVAILING: define available_externally i32 @f()
+; NONPREVAILING-NEXT: ret i32 2
+define linkonce_odr i32 @f() {
+ ret i32 1
+}
diff --git a/test/LTO/Resolution/X86/lowertypetests.ll b/test/LTO/Resolution/X86/lowertypetests.ll
new file mode 100644
index 0000000000000..c84a786e66fc2
--- /dev/null
+++ b/test/LTO/Resolution/X86/lowertypetests.ll
@@ -0,0 +1,21 @@
+; RUN: opt -thinlto-bc -o %t %s
+; RUN: llvm-lto2 run -r %t,f,plx -r %t,foo,lx -r %t,foo,plx -o %t1 %t
+; RUN: llvm-nm %t1.0 | FileCheck --check-prefix=MERGED %s
+; RUN: llvm-nm %t1.1 | FileCheck %s
+
+; MERGED: R __typeid_foo_global_addr
+; CHECK: U __typeid_foo_global_addr
+
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+@foo = global i32 0, !type !0
+
+define i1 @f(i8* %ptr) {
+ %p = call i1 @llvm.type.test(i8* %ptr, metadata !"foo")
+ ret i1 %p
+}
+
+declare i1 @llvm.type.test(i8* %ptr, metadata %typeid) nounwind readnone
+
+!0 = !{i32 0, !"foo"}
diff --git a/test/LTO/Resolution/X86/mixed_lto.ll b/test/LTO/Resolution/X86/mixed_lto.ll
index 02b15c6115448..aa686a8114c96 100644
--- a/test/LTO/Resolution/X86/mixed_lto.ll
+++ b/test/LTO/Resolution/X86/mixed_lto.ll
@@ -2,7 +2,7 @@
; RUN: opt %s -o %t1.o
; RUN: opt -module-summary %p/Inputs/mixed_lto.ll -o %t2.o
-; RUN: llvm-lto2 -o %t3.o %t2.o %t1.o -r %t2.o,main,px -r %t2.o,g, -r %t1.o,g,px
+; RUN: llvm-lto2 run -o %t3.o %t2.o %t1.o -r %t2.o,main,px -r %t2.o,g, -r %t1.o,g,px
; Task 0 is the regular LTO file (this file)
; RUN: llvm-nm %t3.o.0 | FileCheck %s --check-prefix=NM0
@@ -15,7 +15,7 @@
; Do the same test again, but with the regular and thin LTO modules in the same file.
; RUN: llvm-cat -b -o %t4.o %t2.o %t1.o
-; RUN: llvm-lto2 -o %t5.o %t4.o -r %t4.o,main,px -r %t4.o,g, -r %t4.o,g,px
+; RUN: llvm-lto2 run -o %t5.o %t4.o -r %t4.o,main,px -r %t4.o,g, -r %t4.o,g,px
; RUN: llvm-nm %t5.o.0 | FileCheck %s --check-prefix=NM0
; RUN: llvm-nm %t5.o.1 | FileCheck %s --check-prefix=NM1
diff --git a/test/LTO/Resolution/X86/multi-thinlto.ll b/test/LTO/Resolution/X86/multi-thinlto.ll
index 8af73a328a135..06150e44a1670 100644
--- a/test/LTO/Resolution/X86/multi-thinlto.ll
+++ b/test/LTO/Resolution/X86/multi-thinlto.ll
@@ -1,6 +1,6 @@
; RUN: opt -module-summary %s -o %t.o
; RUN: llvm-cat -b -o %t2.o %t.o %t.o
-; RUN: not llvm-lto2 -o %t3.o %t2.o 2>&1 | FileCheck %s
+; RUN: not llvm-lto2 run -o %t3.o %t2.o 2>&1 | FileCheck %s
; CHECK: Expected at most one ThinLTO module per bitcode file
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
diff --git a/test/LTO/Resolution/X86/symtab-elf.ll b/test/LTO/Resolution/X86/symtab-elf.ll
new file mode 100644
index 0000000000000..1683b061c6d6e
--- /dev/null
+++ b/test/LTO/Resolution/X86/symtab-elf.ll
@@ -0,0 +1,15 @@
+; RUN: llvm-as -o %t %s
+; RUN: llvm-lto2 dump-symtab %t | FileCheck %s
+
+; CHECK: target triple: x86_64-unknown-linux-gnu
+target triple = "x86_64-unknown-linux-gnu"
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
+; CHECK-NOT: linker opts:
+!0 = !{i32 6, !"Linker Options", !{!{!"/include:foo"}}}
+!llvm.module.flags = !{ !0 }
+
+@g1 = global i32 0
+
+; CHECK-NOT: fallback g1
+@g2 = weak alias i32, i32* @g1
diff --git a/test/LTO/Resolution/X86/symtab.ll b/test/LTO/Resolution/X86/symtab.ll
new file mode 100644
index 0000000000000..b7bc117490169
--- /dev/null
+++ b/test/LTO/Resolution/X86/symtab.ll
@@ -0,0 +1,53 @@
+; RUN: llvm-as -o %t %s
+; RUN: llvm-lto2 dump-symtab %t | FileCheck %s
+
+; CHECK: target triple: i686-pc-windows-msvc18.0.0
+target triple = "i686-pc-windows-msvc18.0.0"
+target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
+
+; CHECK: source filename: src.c
+source_filename = "src.c"
+
+; CHECK: linker opts: /include:foo
+!0 = !{i32 6, !"Linker Options", !{!{!"/include:foo"}}}
+!llvm.module.flags = !{ !0 }
+
+; CHECK: D------X _fun
+define i32 @fun() {
+ ret i32 0
+}
+
+; CHECK: H------- _g1
+@g1 = hidden global i32 0
+
+; CHECK: P------- _g2
+@g2 = protected global i32 0
+
+; CHECK: D------- _g3
+@g3 = global i32 0
+
+; CHECK: DU------ _g4
+@g4 = external global i32
+
+; CHECK: D--W---- _g5
+@g5 = weak global i32 0
+
+; CHECK: D--W-O-- _g6
+@g6 = linkonce_odr unnamed_addr global i32 0
+
+; CHECK: D-----T- _g7
+@g7 = thread_local global i32 0
+
+; CHECK: D-C----- _g8
+; CHECK-NEXT: size 4 align 8
+@g8 = common global i32 0, align 8
+
+; CHECK: D------- _g9
+; CHECK-NEXT: comdat g9
+$g9 = comdat any
+@g9 = global i32 0, comdat
+
+; CHECK: D--WI--- _g10
+; CHECK-NEXT: comdat g9
+; CHECK-NEXT: fallback _g9
+@g10 = weak alias i32, i32* @g9