1 ; This tests for various complex cast elimination cases instcombine should
4 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep cast
7 %A = cast int %X to uint
8 %c = setne uint %A, 12 ; Convert to setne int %X, 12
12 bool %test2(int %X, int %Y) {
13 %A = cast int %X to uint
14 %B = cast int %Y to uint
15 %c = setne uint %A, %B ; Convert to setne int %X, %Y
20 %B = cast int %A to uint
21 %C = shl uint %B, ubyte 2
22 %D = cast uint %C to int
26 short %test5(short %A) {
27 %B = cast short %A to uint
29 %D = cast uint %C to short
33 bool %test6(bool %A) {
34 %B = cast bool %A to int
39 bool %test6a(bool %A) {
40 %B = cast bool %A to int
41 %C = setne int %B, -1 ; Always true!
45 bool %test7(sbyte* %A) {
46 %B = cast sbyte* %A to int*
47 %C = seteq int* %B, null