mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-19 01:13:25 +00:00
69ccadd753
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32115 91177308-0d34-0410-b5e6-96231b3b80d8
26 lines
559 B
LLVM
26 lines
559 B
LLVM
; This testcase checks to make sure we can sink values which are only live on
|
|
; some exits out of the loop, and that we can do so without breaking dominator
|
|
; info.
|
|
;
|
|
; RUN: llvm-upgrade < %s | llvm-as | opt -licm | llvm-dis | %prcontext add 1 | grep exit2:
|
|
|
|
implementation ; Functions:
|
|
|
|
int %test(bool %C1, bool %C2, int *%P, int* %Q) {
|
|
Entry:
|
|
br label %Loop
|
|
|
|
Loop:
|
|
br bool %C1, label %Cont, label %exit1
|
|
Cont:
|
|
%X = load int* %P
|
|
store int %X, int* %Q
|
|
%V = add int %X, 1
|
|
br bool %C2, label %Loop, label %exit2
|
|
|
|
exit1:
|
|
ret int 0
|
|
exit2:
|
|
ret int %V
|
|
}
|