blob: 7b572560e4f23f82da07e59b4425cb094efa3f85 [file] [log] [blame]
Andrew Lenharthe4542002006-09-19 18:23:39 +00001; Tests to make sure elimination of casts is working correctly
2; RUN: llvm-as < %s | opt -instcombine -disable-output &&
Reid Spencer3da59db2006-11-27 01:05:10 +00003; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep '\([sz]ext\)\|\(trunc\)'
Andrew Lenharthe4542002006-09-19 18:23:39 +00004
5target pointersize = 32
6
7implementation
8
9sbyte* %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