summaryrefslogtreecommitdiffstats
path: root/llvm/test/Linker
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2015-11-30 18:54:24 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2015-11-30 18:54:24 +0000
commitc98b20b0d6edbb9659907eab879e7ff07391c9e3 (patch)
tree56b46669054f28b3caf4fe3fd549179d1c1a9114 /llvm/test/Linker
parent96029f7880778a1a45932b71513c62124c877cd9 (diff)
downloadbcm5719-llvm-c98b20b0d6edbb9659907eab879e7ff07391c9e3.tar.gz
bcm5719-llvm-c98b20b0d6edbb9659907eab879e7ff07391c9e3.zip
Fix another llvm.ctors merging bug.
We were not looking past casts to see if an element should be included or not. llvm-svn: 254313
Diffstat (limited to 'llvm/test/Linker')
-rw-r--r--llvm/test/Linker/Inputs/ctors3.ll7
-rw-r--r--llvm/test/Linker/ctors3.ll8
2 files changed, 15 insertions, 0 deletions
diff --git a/llvm/test/Linker/Inputs/ctors3.ll b/llvm/test/Linker/Inputs/ctors3.ll
new file mode 100644
index 00000000000..449ccbd90fa
--- /dev/null
+++ b/llvm/test/Linker/Inputs/ctors3.ll
@@ -0,0 +1,7 @@
+$foo = comdat any
+%t = type { i8 }
+@foo = global %t zeroinitializer, comdat
+@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @bar, i8* getelementptr (%t, %t* @foo, i32 0, i32 0) }]
+define internal void @bar() comdat($foo) {
+ ret void
+}
diff --git a/llvm/test/Linker/ctors3.ll b/llvm/test/Linker/ctors3.ll
new file mode 100644
index 00000000000..e62b92dca0b
--- /dev/null
+++ b/llvm/test/Linker/ctors3.ll
@@ -0,0 +1,8 @@
+; RUN: llvm-link -S %s %p/Inputs/ctors3.ll -o - | FileCheck %s
+
+$foo = comdat any
+%t = type { i8 }
+@foo = global %t zeroinitializer, comdat
+
+; CHECK: @foo = global %t zeroinitializer, comdat
+; CHECK: @llvm.global_ctors = appending global [0 x { i32, void ()*, i8* }] zeroinitializer
OpenPOWER on IntegriCloud