aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/IPConstantProp
diff options
context:
space:
mode:
authorMatthijs Kooijman <matthijs@stdin.nl>2008-06-19 09:27:44 +0000
committerMatthijs Kooijman <matthijs@stdin.nl>2008-06-19 09:27:44 +0000
commit3d2ff5f9391857f6ab0458f592fa09c1d4b16f72 (patch)
tree5e235d7e48619bf8dfc5cefccd3f9392309d366a /test/Transforms/IPConstantProp
parentf0da2039d17a3e6b72fd1c0df1f889afac65cbd0 (diff)
downloadexternal_llvm-3d2ff5f9391857f6ab0458f592fa09c1d4b16f72.zip
external_llvm-3d2ff5f9391857f6ab0458f592fa09c1d4b16f72.tar.gz
external_llvm-3d2ff5f9391857f6ab0458f592fa09c1d4b16f72.tar.bz2
Modify some ipconstprop tests to also test with invokes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52491 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/IPConstantProp')
-rw-r--r--test/Transforms/IPConstantProp/return-argument.ll5
-rw-r--r--test/Transforms/IPConstantProp/return-constant.ll10
2 files changed, 13 insertions, 2 deletions
diff --git a/test/Transforms/IPConstantProp/return-argument.ll b/test/Transforms/IPConstantProp/return-argument.ll
index 53288ee..f8605107 100644
--- a/test/Transforms/IPConstantProp/return-argument.ll
+++ b/test/Transforms/IPConstantProp/return-argument.ll
@@ -36,11 +36,14 @@ define void @caller(i1 %C) {
;; propagated per-caller).
%S1 = call { i32, i32 } @foo(i32 1, i32 2);
%X1 = extractvalue { i32, i32 } %S1, 0
- %S2 = call { i32, i32 } @foo(i32 3, i32 4);
+ %S2 = invoke { i32, i32 } @foo(i32 3, i32 4) to label %OK unwind label %RET;
+OK:
%X2 = extractvalue { i32, i32 } %S2, 0
;; Do some stuff with the returned values which we can grep for
%Z = add i32 %X1, %X2
store i32 %Z, i32* %W
+ br label %RET
+RET:
ret void
}
diff --git a/test/Transforms/IPConstantProp/return-constant.ll b/test/Transforms/IPConstantProp/return-constant.ll
index 82ad902..381ef63 100644
--- a/test/Transforms/IPConstantProp/return-constant.ll
+++ b/test/Transforms/IPConstantProp/return-constant.ll
@@ -1,5 +1,5 @@
; RUN: llvm-as < %s | opt -ipconstprop -instcombine | \
-; RUN: llvm-dis | grep {ret i1 true}
+; RUN: llvm-dis | grep {ret i1 true} | count 2
define internal i32 @foo(i1 %C) {
br i1 %C, label %T, label %F
@@ -16,3 +16,11 @@ define i1 @caller(i1 %C) {
ret i1 %Y
}
+define i1 @invokecaller(i1 %C) {
+ %X = invoke i32 @foo( i1 %C ) to label %OK unwind label %FAIL ; <i32> [#uses=1]
+OK:
+ %Y = icmp ne i32 %X, 0 ; <i1> [#uses=1]
+ ret i1 %Y
+FAIL:
+ ret i1 false
+}