llvm-6502/test/Transforms/InstCombine/setcc-cast-cast.ll
Reid Spencer 2b544beda3 For PR1319:
Upgrade tests to work with new llvm.exp version of llvm_runtest.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36013 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-14 20:13:02 +00:00

46 lines
1.3 KiB
LLVM

; This test case was reduced from MultiSource/Applications/hbd. It makes sure
; that folding doesn't happen in case a zext is applied where a sext should have
; been when a setcc is used with two casts.
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: not grep {br bool false}
; END.
int %bug(ubyte %inbuff) {
entry:
%tmp = bitcast ubyte %inbuff to sbyte ; <sbyte> [#uses=1]
%tmp = sext sbyte %tmp to int ; <int> [#uses=3]
%tmp = seteq int %tmp, 1 ; <bool> [#uses=1]
br bool %tmp, label %cond_true, label %cond_next
cond_true: ; preds = %entry
br label %bb
cond_next: ; preds = %entry
%tmp3 = seteq int %tmp, -1 ; <bool> [#uses=1]
br bool %tmp3, label %cond_true4, label %cond_next5
cond_true4: ; preds = %cond_next
br label %bb
cond_next5: ; preds = %cond_next
%tmp7 = setgt int %tmp, 1 ; <bool> [#uses=1]
br bool %tmp7, label %cond_true8, label %cond_false
cond_true8: ; preds = %cond_next5
br label %cond_next9
cond_false: ; preds = %cond_next5
br label %cond_next9
cond_next9: ; preds = %cond_false, %cond_true8
%iftmp.1.0 = phi int [ 42, %cond_true8 ], [ 23, %cond_false ] ; <int> [#uses=1]
br label %return
bb: ; preds = %cond_true4, %cond_true
br label %return
return: ; preds = %bb, %cond_next9
%retval.0 = phi int [ 17, %bb ], [ %iftmp.1.0, %cond_next9 ] ; <int> [#uses=1]
ret int %retval.0
}