mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-01 00:33:09 +00:00
NEw "feature" test that cee should eventually handle
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4053 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0c5e362118
commit
19ee34a334
44
test/Transforms/CorrelatedExprs/looptest.ll
Normal file
44
test/Transforms/CorrelatedExprs/looptest.ll
Normal file
@ -0,0 +1,44 @@
|
||||
; This testcase tests to see if adds and PHI's are handled in their full
|
||||
; generality. This testcase comes from the following C code:
|
||||
;
|
||||
; void f() {
|
||||
; int i;
|
||||
; for (i = 1; i < 100; i++) {
|
||||
; if (i)
|
||||
; g();
|
||||
; }
|
||||
; }
|
||||
;
|
||||
; Note that this is a "feature" test, not a correctness test.
|
||||
;
|
||||
; RUN: if as < %s | opt -cee -simplifycfg | dis | grep cond213
|
||||
; RUN: then exit 1
|
||||
; RUN: else exit 0
|
||||
; RUN: fi
|
||||
;
|
||||
implementation ; Functions:
|
||||
|
||||
declare void %g()
|
||||
|
||||
void %f() {
|
||||
bb0: ; No predecessors!
|
||||
br label %bb2
|
||||
|
||||
bb2: ; preds = %bb4, %bb0
|
||||
%cann-indvar = phi int [ 0, %bb0 ], [ %add1-indvar, %bb4 ] ; <int> [#uses=2]
|
||||
%add1-indvar = add int %cann-indvar, 1 ; <int> [#uses=2]
|
||||
%cond213 = seteq int %add1-indvar, 0 ; <bool> [#uses=1]
|
||||
br bool %cond213, label %bb4, label %bb3
|
||||
|
||||
bb3: ; preds = %bb2
|
||||
call void %g( )
|
||||
br label %bb4
|
||||
|
||||
bb4: ; preds = %bb3, %bb2
|
||||
%reg109 = add int %cann-indvar, 2 ; <int> [#uses=1]
|
||||
%cond217 = setle int %reg109, 99 ; <bool> [#uses=1]
|
||||
br bool %cond217, label %bb2, label %bb5
|
||||
|
||||
bb5: ; preds = %bb4
|
||||
ret void
|
||||
}
|
Loading…
Reference in New Issue
Block a user