42b7ad9b7ceb963e8ebb09e8171f0d634d8379b6
[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 -dce | grep '%c'
4 ; RUN: then exit 1
5 ; RUN: else exit 0
6 ; RUN: fi
7
8 implementation
9
10 int "test1"(int %A)
11 begin
12         %c1 = cast int %A to uint
13         %c2 = cast uint %c1 to int
14         ret int %c2
15 end
16
17 ulong "test2"(ubyte %A)
18 begin
19         %c1 = cast ubyte %A to ushort
20         %c2 = cast ushort %c1 to uint
21         %Ret = cast uint %c2 to ulong
22         ret ulong %Ret
23 end