ConstantFold: Shifting undef by zero results in undef
[oota-llvm.git] / test / Transforms / InstSimplify / undef.ll
index bf643171cc1f9450c6bfd2d518c335cc3d49897e..e8b49b6397dbd08966c3686c5d3f5d435b6f4134 100644 (file)
@@ -244,3 +244,24 @@ define i32 @test31(i32 %a) {
   %b = shl i32 undef, %a
   ret i32 %b
 }
+
+; CHECK-LABEL: @test32
+; CHECK: ret i32 undef
+define i32 @test32(i32 %a) {
+  %b = shl i32 undef, 0
+  ret i32 %b
+}
+
+; CHECK-LABEL: @test33
+; CHECK: ret i32 undef
+define i32 @test33(i32 %a) {
+  %b = ashr i32 undef, 0
+  ret i32 %b
+}
+
+; CHECK-LABEL: @test34
+; CHECK: ret i32 undef
+define i32 @test34(i32 %a) {
+  %b = lshr i32 undef, 0
+  ret i32 %b
+}