PR9055: extend the fix to PR4050 (r70179) to apply to zext and anyext.
[oota-llvm.git] / test / Transforms / LoopUnswitch / crash.ll
index a50bd54e7870843079f9d57c3b202073ace8f283..101fb7a2c2ce3fc168a20da492c5e42a352d171c 100644 (file)
@@ -1,6 +1,6 @@
 ; RUN: opt < %s -loop-unswitch -disable-output
 
-define void @sort_Eq(i32* %S2) {
+define void @test1(i32* %S2) {
 entry:
        br i1 false, label %list_Length.exit, label %cond_true.i
 cond_true.i:           ; preds = %entry
@@ -30,3 +30,37 @@ return:              ; preds = %return.loopexit, %list_Length.exit9
        ret void
 }
 
+define void @test2(i32 %x1, i32 %y1, i32 %z1, i32 %r1) nounwind {
+entry:
+  br label %bb.nph
+
+bb.nph:                                           ; preds = %entry
+  %and.i13521 = and <4 x i1> undef, undef         ; <<4 x i1>> [#uses=1]
+  br label %for.body
+
+for.body:                                         ; preds = %for.body, %bb.nph
+  %or.i = select <4 x i1> %and.i13521, <4 x i32> undef, <4 x i32> undef ; <<4 x i32>> [#uses=0]
+  br i1 false, label %for.body, label %for.end
+
+for.end:                                          ; preds = %for.body, %entry
+  ret void
+}
+
+; PR6879
+define i32* @test3(i32** %p_45, i16 zeroext %p_46, i64 %p_47, i64 %p_48, i16 signext %p_49) nounwind {
+entry:
+  br label %for.cond
+
+for.cond:                                         ; preds = %for.cond4, %entry
+  br i1 false, label %for.cond4, label %for.end88
+
+for.cond4:                                        ; preds = %for.cond
+  %conv46 = trunc i32 0 to i8                     ; <i8> [#uses=2]
+  %cmp60 = icmp sgt i8 %conv46, 124               ; <i1> [#uses=1]
+  %or.cond = and i1 undef, %cmp60                 ; <i1> [#uses=1]
+  %cond = select i1 %or.cond, i8 %conv46, i8 undef ; <i8> [#uses=0]
+  br label %for.cond
+
+for.end88:                                        ; preds = %for.cond
+  ret i32* undef
+}