1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

New testcase for bug found by Vikram

llvm-svn: 2426
This commit is contained in:
Chris Lattner 2002-05-02 16:16:39 +00:00
parent 87b97fc7c6
commit 6c6eb4e034

View File

@ -0,0 +1,24 @@
; This test contains two cast instructions that cannot be eliminated. If the
; input of the "test" function is negative, it should be correctly converted
; to a 32 bit version of the number with all upper 16 bits clear (ushort->uint
; involves no sign extension). Optimizing this to a single cast is invalid!
;
; RUN: as < %s | opt -raise -q | lli -abort-on-exception
;
implementation
uint "test"(short %argc)
begin
%cast223 = cast short %argc to ushort ; <ushort> [#uses=1]
%cast114 = cast ushort %cast223 to uint ; <uint> [#uses=1]
ret uint %cast114
end
int "main"()
begin
%Ret = call uint %test(short -1)
%test = cast uint %Ret to int
%Res = seteq int %test, -1 ; If it returns -1 as int, it's a failure
%Res = cast bool %Res to int
ret int %Res
end