[InstCombine] Don't miscompile select to poison
[oota-llvm.git] / test / Transforms / InstCombine / intrinsics.ll
index f9ccf51a621f9f3d759c31cc10d76c05cf24569b..9767704c85cfd9e284f3319ec93a9049d5e7f551 100644 (file)
@@ -417,3 +417,11 @@ define %ov.result.32 @ssubtest_reorder(i8 %a) {
 ; CHECK-NEXT: %1 = insertvalue %ov.result.32 { i32 undef, i1 false }, i32 %x, 0
 ; CHECK-NEXT:  ret %ov.result.32 %1
 }
+
+define %ov.result.32 @never_overflows_ssub_test0(i32 %a) {
+  %x = call %ov.result.32 @llvm.ssub.with.overflow.i32(i32 %a, i32 0)
+  ret %ov.result.32 %x
+; CHECK-LABEL: @never_overflows_ssub_test0
+; CHECK-NEXT: %[[x:.*]] = insertvalue %ov.result.32 { i32 undef, i1 false }, i32 %a, 0
+; CHECK-NEXT:  ret %ov.result.32 %[[x]]
+}