summaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine/trunc.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/Transforms/InstCombine/trunc.ll')
-rw-r--r--test/Transforms/InstCombine/trunc.ll21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/trunc.ll b/test/Transforms/InstCombine/trunc.ll
index 38f6b2804d637..2019b3a6df47f 100644
--- a/test/Transforms/InstCombine/trunc.ll
+++ b/test/Transforms/InstCombine/trunc.ll
@@ -160,3 +160,24 @@ define i32 @trunc_bitcast3(<4 x i32> %v) {
; CHECK-NEXT: ret i32 %ext
}
+; CHECK-LABEL: @trunc_shl_infloop(
+; CHECK: %tmp = lshr i64 %arg, 1
+; CHECK: %tmp21 = shl i64 %tmp, 2
+; CHECK: %tmp2 = trunc i64 %tmp21 to i32
+; CHECK: icmp sgt i32 %tmp2, 0
+define void @trunc_shl_infloop(i64 %arg) {
+bb:
+ %tmp = lshr i64 %arg, 1
+ %tmp1 = trunc i64 %tmp to i32
+ %tmp2 = shl i32 %tmp1, 2
+ %tmp3 = icmp sgt i32 %tmp2, 0
+ br i1 %tmp3, label %bb2, label %bb1
+
+bb1:
+ %tmp5 = sub i32 0, %tmp1
+ %tmp6 = sub i32 %tmp5, 1
+ unreachable
+
+bb2:
+ unreachable
+}