[llvm-commits] [llvm] r52491 - in /llvm/trunk/test/Transforms/IPConstantProp: return-argument.ll return-constant.ll
Matthijs Kooijman
matthijs at stdin.nl
Thu Jun 19 02:27:45 PDT 2008
Author: matthijs
Date: Thu Jun 19 04:27:44 2008
New Revision: 52491
URL: http://llvm.org/viewvc/llvm-project?rev=52491&view=rev
Log:
Modify some ipconstprop tests to also test with invokes.
Modified:
llvm/trunk/test/Transforms/IPConstantProp/return-argument.ll
llvm/trunk/test/Transforms/IPConstantProp/return-constant.ll
Modified: llvm/trunk/test/Transforms/IPConstantProp/return-argument.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/IPConstantProp/return-argument.ll?rev=52491&r1=52490&r2=52491&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/IPConstantProp/return-argument.ll (original)
+++ llvm/trunk/test/Transforms/IPConstantProp/return-argument.ll Thu Jun 19 04:27:44 2008
@@ -36,11 +36,14 @@
;; 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
}
Modified: llvm/trunk/test/Transforms/IPConstantProp/return-constant.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/IPConstantProp/return-constant.ll?rev=52491&r1=52490&r2=52491&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/IPConstantProp/return-constant.ll (original)
+++ llvm/trunk/test/Transforms/IPConstantProp/return-constant.ll Thu Jun 19 04:27:44 2008
@@ -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 @@
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
+}
More information about the llvm-commits
mailing list