summaryrefslogtreecommitdiff
path: root/test/Transforms/ConstantMerge
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2011-01-15 18:14:21 +0000
committerNick Lewycky <nicholas@mxc.ca>2011-01-15 18:14:21 +0000
commit2820c25e847c76f241388446f6f3dd86e067403b (patch)
tree75f3a7a0bfe8fd396865147c8e10d2c1428dd159 /test/Transforms/ConstantMerge
parent111fd9ce64726867c634dc8bbe042c6eb8de85fc (diff)
downloadllvm-2820c25e847c76f241388446f6f3dd86e067403b.tar.gz
llvm-2820c25e847c76f241388446f6f3dd86e067403b.tar.bz2
llvm-2820c25e847c76f241388446f6f3dd86e067403b.tar.xz
Make constmerge a two-pass algorithm so that it won't miss merging
opporuntities. Fixes PR8978. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123541 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/ConstantMerge')
-rw-r--r--test/Transforms/ConstantMerge/2011-01-15-EitherOrder.ll18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/Transforms/ConstantMerge/2011-01-15-EitherOrder.ll b/test/Transforms/ConstantMerge/2011-01-15-EitherOrder.ll
new file mode 100644
index 0000000000..7001ce1ba4
--- /dev/null
+++ b/test/Transforms/ConstantMerge/2011-01-15-EitherOrder.ll
@@ -0,0 +1,18 @@
+; RUN: opt -constmerge %s -S -o - | FileCheck %s
+; PR8978
+
+declare i32 @zed(%struct.foobar*, %struct.foobar*)
+
+%struct.foobar = type { i32 }
+; CHECK: bar.d
+@bar.d = constant %struct.foobar zeroinitializer, align 4
+; CHECK-NOT: foo.d
+@foo.d = internal constant %struct.foobar zeroinitializer, align 4
+define i32 @main() nounwind ssp {
+entry:
+; CHECK: bar.d
+ %call2 = tail call i32 @zed(%struct.foobar* @foo.d, %struct.foobar* @bar.d)
+nounwind
+ ret i32 0
+}
+