New testcases for signed shifts
authorChris Lattner <sabre@nondot.org>
Thu, 24 Jul 2003 18:38:09 +0000 (18:38 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 24 Jul 2003 18:38:09 +0000 (18:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7294 91177308-0d34-0410-b5e6-96231b3b80d8

test/Transforms/InstCombine/shift.ll

index 2def834e8726d06b1424b6c012bcba47743d8c00..6a496d3723b8654a79fc439a1f9d3eb392af13ae 100644 (file)
@@ -63,9 +63,20 @@ ubyte %test10(ubyte %A) {              ;; (A >> 7) << 7 === A & 128
        ret ubyte %C
 }
 
-ubyte %test11(ubyte %A) {              ;; (A >> 3) << 4 == (A & 0x1F) << 1
+ubyte %test11(ubyte %A) {              ;; (A >> 3) << 4 === (A & 0x1F) << 1
        %B = shr ubyte %A, ubyte 3
        %C = shl ubyte %B, ubyte 4
        ret ubyte %C
 }
 
+int %test12(int %A) {
+        %B = shr int %A, ubyte 8    ;; (A >> 8) << 8 === A & -256
+        %C = shl int %B, ubyte 8
+        ret int %C
+}
+
+sbyte %test13(sbyte %A) {           ;; (A >> 3) << 4 === (A & -8) * 2
+       %B = shr sbyte %A, ubyte 3
+       %C = shl sbyte %B, ubyte 4
+       ret sbyte %C
+}