aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/GVNPRE
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2007-06-16 00:25:10 +0000
committerOwen Anderson <resistor@mac.com>2007-06-16 00:25:10 +0000
commit981746b4d0447fcc0f5e96fbc984d4ee52b92ab3 (patch)
treef9f917403582a8f0d8c3f2157481ecabd206d052 /test/Transforms/GVNPRE
parent24e5aada7d112447c41c12008f7daf1fc15a24bc (diff)
downloadexternal_llvm-981746b4d0447fcc0f5e96fbc984d4ee52b92ab3.zip
external_llvm-981746b4d0447fcc0f5e96fbc984d4ee52b92ab3.tar.gz
external_llvm-981746b4d0447fcc0f5e96fbc984d4ee52b92ab3.tar.bz2
Testcase where GVNPRE was getting confused by invoke instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37609 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/GVNPRE')
-rw-r--r--test/Transforms/GVNPRE/2007-06-15-InvokeInst.ll70
1 files changed, 70 insertions, 0 deletions
diff --git a/test/Transforms/GVNPRE/2007-06-15-InvokeInst.ll b/test/Transforms/GVNPRE/2007-06-15-InvokeInst.ll
new file mode 100644
index 0000000..1d8f3b5
--- /dev/null
+++ b/test/Transforms/GVNPRE/2007-06-15-InvokeInst.ll
@@ -0,0 +1,70 @@
+; RUN: llvm-as < %s | opt -gvnpre | llvm-dis
+
+@.str1 = external constant [4 x i8] ; <[4 x i8]*> [#uses=1]
+@.str2 = external constant [5 x i8] ; <[5 x i8]*> [#uses=1]
+
+define i32 @main(i32 %argc, i8** %argv) {
+entry:
+ br i1 false, label %cond_next, label %cond_true
+
+cond_true: ; preds = %entry
+ ret i32 0
+
+cond_next: ; preds = %entry
+ %tmp10 = invoke i16 @_ZN12token_stream4openEPKc( i8* null, i8* null ) sext
+ to label %invcont unwind label %cleanup690 ; <i16> [#uses=0]
+
+invcont: ; preds = %cond_next
+ %tmp15 = invoke i32 (i8*, ...)* @printf( i8* getelementptr ([4 x i8]* @.str1, i32 0, i32 0) )
+ to label %invcont14 unwind label %cleanup685 ; <i32> [#uses=0]
+
+invcont14: ; preds = %invcont
+ %tmp17 = invoke i8* @_ZN24lambda_expression_parser10expressionEPP11arglst_node( i8* null, i8** null )
+ to label %cond_true22 unwind label %cleanup685
+
+cond_true22: ; preds = %invcont14
+ %tmp35 = invoke i32 null( i8* null )
+ to label %cond_next56 unwind label %cleanup685 ; <i32> [#uses=0]
+
+cond_next56: ; preds = %cond_true22
+ %tmp59 = invoke i32 (i8*, ...)* @printf( i8* getelementptr ([5 x i8]* @.str2, i32 0, i32 0) )
+ to label %invcont58 unwind label %cleanup685 ; <i32> [#uses=0]
+
+invcont58: ; preds = %cond_next56
+ invoke void null( i8* null, i8* null, i32 0 )
+ to label %invcont72 unwind label %cleanup685
+
+invcont72: ; preds = %invcont58
+ %tmp143 = invoke i32 null( i8* null )
+ to label %invcont142 unwind label %cleanup685 ; <i32> [#uses=0]
+
+invcont142: ; preds = %invcont72
+ br i1 false, label %cond_false407, label %cond_true150
+
+cond_true150: ; preds = %invcont142
+ ret i32 0
+
+cond_false407: ; preds = %invcont142
+ %tmp431 = invoke i8* null( i8* null, i8* null, i32 0, i32* null )
+ to label %bb432 unwind label %cleanup685
+
+bb432: ; preds = %bb432, %cond_false407
+ %rexp413.7 = phi i8* [ %tmp431, %cond_false407 ], [ %rexp413.7, %bb432 ]
+ %tmp434 = icmp eq i8* %rexp413.7, null ; <i1> [#uses=1]
+ br i1 %tmp434, label %bb432, label %cond_true437
+
+cond_true437: ; preds = %bb432
+ ret i32 0
+
+cleanup685: ; preds = %cond_false407, %invcont72, %invcont58, %cond_next56, %cond_true22, %invcont14, %invcont
+ ret i32 0
+
+cleanup690: ; preds = %cond_next
+ ret i32 0
+}
+
+declare i16 @_ZN12token_stream4openEPKc(i8*, i8*) sext
+
+declare i32 @printf(i8*, ...)
+
+declare i8* @_ZN24lambda_expression_parser10expressionEPP11arglst_node(i8*, i8**)