aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-07-24 18:38:09 +0000
committerChris Lattner <sabre@nondot.org>2003-07-24 18:38:09 +0000
commit709ad40dc814fa10e13caef5487fe10b6f19e62a (patch)
treec5446e14131fd2032c32efbf47efdef598ff6f72 /test
parent5073336cd4da5df4ae13a167582d1dc90f32e4e0 (diff)
downloadexternal_llvm-709ad40dc814fa10e13caef5487fe10b6f19e62a.zip
external_llvm-709ad40dc814fa10e13caef5487fe10b6f19e62a.tar.gz
external_llvm-709ad40dc814fa10e13caef5487fe10b6f19e62a.tar.bz2
New testcases for signed shifts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7294 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Transforms/InstCombine/shift.ll13
1 files changed, 12 insertions, 1 deletions
diff --git a/test/Transforms/InstCombine/shift.ll b/test/Transforms/InstCombine/shift.ll
index 2def834..6a496d3 100644
--- a/test/Transforms/InstCombine/shift.ll
+++ b/test/Transforms/InstCombine/shift.ll
@@ -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
+}