Add some tests for shr-and folding

llvm-svn: 16507
This commit is contained in:
Chris Lattner 2004-09-24 15:18:43 +00:00
parent 52263072bc
commit 243761aade

View File

@ -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
}