aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/SCCP
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-04-23 05:38:20 +0000
committerChris Lattner <sabre@nondot.org>2008-04-23 05:38:20 +0000
commitc6ee00b8eec0a682f25810c7912272cd76c87a2c (patch)
treebd5bb5e9c946db4ef77ef0c4e9b55f8ab6dbb5b6 /test/Transforms/SCCP
parenta925a14698fd58b495083542df16e6096aee6f37 (diff)
downloadexternal_llvm-c6ee00b8eec0a682f25810c7912272cd76c87a2c.zip
external_llvm-c6ee00b8eec0a682f25810c7912272cd76c87a2c.tar.gz
external_llvm-c6ee00b8eec0a682f25810c7912272cd76c87a2c.tar.bz2
Rewrite multiple return value handling in SCCP. Before, the -sccp pass
would turn every getresult instruction into undef. This helps with rdar://5778210 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50140 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/SCCP')
-rw-r--r--test/Transforms/SCCP/2008-04-22-multiple-ret-sccp.ll11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/Transforms/SCCP/2008-04-22-multiple-ret-sccp.ll b/test/Transforms/SCCP/2008-04-22-multiple-ret-sccp.ll
new file mode 100644
index 0000000..99f9136
--- /dev/null
+++ b/test/Transforms/SCCP/2008-04-22-multiple-ret-sccp.ll
@@ -0,0 +1,11 @@
+; RUN: llvm-as < %s | opt -sccp | llvm-dis | grep {ret i32 %Z}
+; rdar://5778210
+
+declare {i32, i32} @bar(i32 %A)
+
+define i32 @foo() {
+ %X = call {i32, i32} @bar(i32 17)
+ %Y = getresult {i32, i32} %X, 0
+ %Z = add i32 %Y, %Y
+ ret i32 %Z
+}