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

New testcases

llvm-svn: 6412
This commit is contained in:
Chris Lattner 2003-05-29 20:15:35 +00:00
parent 4636cc8a1d
commit 9444ef7a2c
2 changed files with 66 additions and 0 deletions

View File

@ -0,0 +1,32 @@
; Test to make sure that SSA is correctly updated
; RUN: as < %s | opt -cee
;
implementation ; Functions:
int %test(int %A, int %B, bool %c0) {
Start: ; No predecessors!
%c1 = seteq int %A, %B ; <bool> [#uses=1]
br bool %c1, label %Eq, label %Start_crit_edge
Start_crit_edge: ; preds = %Start
br label %Loop
Eq: ; preds = %Start
br label %Loop
Loop: ; preds = %Bottom, %Eq, %Start_crit_edge
%Z = phi int [ %A, %Start_crit_edge ], [ %B, %Eq ], [ %Z, %Bottom ] ; <int> [#uses=2]
%c2 = setge int %A, %B ; <bool> [#uses=1]
br bool %c2, label %Forwarded, label %Loop_crit_edge
Loop_crit_edge: ; preds = %Loop
br label %Bottom
Forwarded: ; preds = %Loop
%Z2 = phi int [ %Z, %Loop ] ; <int> [#uses=1]
call int %test( int 0, int %Z2, bool true ) ; <int>:0 [#uses=0]
br label %Bottom
Bottom: ; preds = %Forwarded, %Loop_crit_edge
br label %Loop
}

View File

@ -0,0 +1,34 @@
; Simple test to make sure dominators are updated properly
; RUN: as < %s | opt -cee
implementation ; Functions:
int %test(int %A, int %B, bool %c0) {
Start: ; No predecessors!
%c1 = seteq int %A, %B ; <bool> [#uses=1]
br bool %c1, label %Eq, label %Start_crit_edge
Start_crit_edge: ; preds = %Start
br label %Loop
Eq: ; preds = %Start
br label %Loop
Loop: ; preds = %Bottom, %Eq, %Start_crit_edge
%Z = phi int [ %A, %Start_crit_edge ], [ %B, %Eq ];, [ %Z, %Bottom ] ; <int> [#uses=2]
%c2 = setge int %A, %B ; <bool> [#uses=1]
br bool %c2, label %Forwarded, label %Loop_crit_edge
Loop_crit_edge: ; preds = %Loop
%X = seteq int %Z, 7
br bool %X, label %Forwarded, label %Bottom
Forwarded: ; preds = %Loop
%Z2 = phi int [ %Z, %Loop ], [%Z, %Loop_crit_edge] ; <int> [#uses=1]
call int %test( int %Z, int %Z2, bool true ) ; <int>:0 [#uses=0]
br label %Bottom
Bottom: ; preds = %Forwarded, %Loop_crit_edge
ret int %Z
;br label %Loop
}