New testcase distilled from:
[oota-llvm.git] / test / Transforms / InstCombine / cast-set.ll
index 55947d6b7e5198a2e2cbdabba5f98fd74bde347e..721faefc105e63013b6fbe2ab7cbab38fd6822d7 100644 (file)
@@ -3,11 +3,11 @@
 ; slow.  Might it be better to make there be an instcombine prepass before
 ; level raise that takes care of the obvious stuff?
 
-; RUN: as < %s | opt -instcombine | dis | not grep cast
+; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep cast
 
 bool %test1(int %X) {
        %A = cast int %X to uint
-       %c = setne uint %A, 0        ; Convert to setne int %X, 0
+       %c = setne uint %A, 12        ; Convert to setne int %X, 12
        ret bool %c
 }
 
@@ -30,8 +30,15 @@ bool %test3(int %A, int %B) {
 
 int %test4(int %A) {
        %B = cast int %A to uint
-       %C = shl uint %B, ubyte 1
+       %C = shl uint %B, ubyte 2
        %D = cast uint %C to int
        ret int %D
 }
 
+short %test5(short %A) {
+       %B = cast short %A to uint
+       %C = and uint %B, 15
+       %D = cast uint %C to short
+       ret short %D
+}
+