summaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine/and.ll
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-09-24 15:18:43 +0000
committerChris Lattner <sabre@nondot.org>2004-09-24 15:18:43 +0000
commit71dd80105531c7d1df9719be03abd0e55f7e98b4 (patch)
treee9406965c1733f574132fa19dbec972c4ab57235 /test/Transforms/InstCombine/and.ll
parent5fbb1f8fccd7226d7cd83442570856fcc9a7bf8e (diff)
downloadllvm-71dd80105531c7d1df9719be03abd0e55f7e98b4.tar.gz
llvm-71dd80105531c7d1df9719be03abd0e55f7e98b4.tar.bz2
llvm-71dd80105531c7d1df9719be03abd0e55f7e98b4.tar.xz
Add some tests for shr-and folding
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16507 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/and.ll')
-rw-r--r--test/Transforms/InstCombine/and.ll17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/and.ll b/test/Transforms/InstCombine/and.ll
index 703dea3326..ba30d816df 100644
--- a/test/Transforms/InstCombine/and.ll
+++ b/test/Transforms/InstCombine/and.ll
@@ -119,3 +119,20 @@ bool %test18(int %A) {
ret bool %C
}
+int %test19(int %A) {
+ %B = shl int %A, ubyte 3
+ %C = and int %B, -2 ;; Clearing a zero bit
+ ret int %C
+}
+
+ubyte %test20(ubyte %A) {
+ %C = shr ubyte %A, ubyte 7
+ %D = and ubyte %C, 1 ;; Unneeded
+ ret ubyte %D
+}
+
+sbyte %test21(sbyte %A) {
+ %C = shr sbyte %A, ubyte 7 ;; sign extend
+ %D = and sbyte %C, 1 ;; chop off sign
+ ret sbyte %D
+}