Fix testcase to actually test what we think we are
[oota-llvm.git] / test / Transforms / InstCombine / cast.ll
1 ; Tests to make sure elimination of casts is working correctly
2
3 ; RUN: if as < %s | opt -instcombine -die | dis | grep '%c' | grep cast
4 ; RUN: then exit 1
5 ; RUN: else exit 0
6 ; RUN: fi
7
8 implementation
9
10 int %test1(int %A) {
11         %c1 = cast int %A to uint
12         %c2 = cast uint %c1 to int
13         ret int %c2
14 }
15
16 ulong %test2(ubyte %A) {
17         %c1 = cast ubyte %A to ushort
18         %c2 = cast ushort %c1 to uint
19         %Ret = cast uint %c2 to ulong
20         ret ulong %Ret
21 }
22
23 ulong %test3(ulong %A) {    ; This function should just use bitwise AND
24         %c1 = cast ulong %A to ubyte
25         %c2 = cast ubyte %c1 to ulong
26         ret ulong %c2
27 }