Inspired by the linux kernel, the more we keep adds in the pointer realm, the better...
[oota-llvm.git] / test / Transforms / InstCombine / cast_ptr.ll
1 ; Tests to make sure elimination of casts is working correctly
2 ; RUN: llvm-as < %s | opt -instcombine -disable-output &&
3 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep cast
4
5 target pointersize = 32
6
7 implementation
8
9 sbyte* %test1(sbyte* %t) {
10         %tmpc = cast sbyte* %t to uint
11         %tmpa = add uint %tmpc, 32
12         %tv = cast uint %tmpa to sbyte*
13         ret sbyte* %tv
14 }
15