2006-09-19 18:23:39 +00:00
|
|
|
; Tests to make sure elimination of casts is working correctly
|
2006-12-02 04:23:10 +00:00
|
|
|
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -disable-output &&
|
2007-02-23 19:39:24 +00:00
|
|
|
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | notcast
|
|
|
|
; XFAIL: *
|
2006-09-19 18:23:39 +00:00
|
|
|
|
|
|
|
target pointersize = 32
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
sbyte* %test1(sbyte* %t) {
|
|
|
|
%tmpc = cast sbyte* %t to uint
|
|
|
|
%tmpa = add uint %tmpc, 32
|
|
|
|
%tv = cast uint %tmpa to sbyte*
|
|
|
|
ret sbyte* %tv
|
|
|
|
}
|
|
|
|
|
2007-02-22 15:17:45 +00:00
|
|
|
bool %test2(sbyte* %a, sbyte* %b) {
|
|
|
|
%tmpa = cast sbyte* %a to uint
|
|
|
|
%tmpb = cast sbyte* %b to uint
|
|
|
|
%r = seteq uint %tmpa, %tmpb
|
|
|
|
ret bool %r
|
|
|
|
}
|