[SystemZ] Add test missing from r186148
[oota-llvm.git] / test / Transforms / InstCombine / signext.ll
index 1c52b62df4e0ba695a18875b39002075e1e9fc69..5ed1cd5590ae921930574811391b8ad8f7c2caea 100644 (file)
@@ -8,8 +8,8 @@ define i32 @test1(i32 %x) {
         %tmp.3 = add i32 %tmp.2, 32768          ; <i32> [#uses=1]
         ret i32 %tmp.3
 ; CHECK: @test1
-; CHECK: %sext1 = shl i32 %x, 16
-; CHECK: %tmp.3 = ashr i32 %sext1, 16
+; CHECK: %sext = shl i32 %x, 16
+; CHECK: %tmp.3 = ashr exact i32 %sext, 16
 ; CHECK: ret i32 %tmp.3
 }
 
@@ -19,8 +19,8 @@ define i32 @test2(i32 %x) {
         %tmp.3 = add i32 %tmp.2, -32768         ; <i32> [#uses=1]
         ret i32 %tmp.3
 ; CHECK: @test2
-; CHECK: %sext1 = shl i32 %x, 16
-; CHECK: %tmp.3 = ashr i32 %sext1, 16
+; CHECK: %sext = shl i32 %x, 16
+; CHECK: %tmp.3 = ashr exact i32 %sext, 16
 ; CHECK: ret i32 %tmp.3
 }
 
@@ -50,8 +50,8 @@ define i32 @test5(i32 %x) {
         %tmp.3 = add i32 %tmp.2, -128           ; <i32> [#uses=1]
         ret i32 %tmp.3
 ; CHECK: @test5
-; CHECK: %sext1 = shl i32 %x, 24
-; CHECK: %tmp.3 = ashr i32 %sext1, 24
+; CHECK: %sext = shl i32 %x, 24
+; CHECK: %tmp.3 = ashr exact i32 %sext, 24
 ; CHECK: ret i32 %tmp.3
 }
 
@@ -61,7 +61,7 @@ define i32 @test6(i32 %x) {
         ret i32 %tmp.4
 ; CHECK: @test6
 ; CHECK: %tmp.2 = shl i32 %x, 16
-; CHECK: %tmp.4 = ashr i32 %tmp.2, 16
+; CHECK: %tmp.4 = ashr exact i32 %tmp.2, 16
 ; CHECK: ret i32 %tmp.4
 }
 
@@ -74,3 +74,14 @@ define i32 @test7(i16 %P) {
 ; CHECK: %tmp.5 = sext i16 %P to i32
 ; CHECK: ret i32 %tmp.5
 }
+
+define i32 @test8(i32 %x) nounwind readnone {
+entry:
+  %shr = lshr i32 %x, 5                           ; <i32> [#uses=1]
+  %xor = xor i32 %shr, 67108864                   ; <i32> [#uses=1]
+  %sub = add i32 %xor, -67108864                  ; <i32> [#uses=1]
+  ret i32 %sub
+; CHECK: @test8
+; CHECK: %sub = ashr i32 %x, 5
+; CHECK: ret i32 %sub
+}