mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-01 00:11:00 +00:00
9aafdcf20d
Upgrade to use new Tcl exec based test harness. This exposes 3 bugs that were previously not being reported: test/Transforms/GlobalDCE/2002-08-17-FunctionDGE.ll test/Transforms/GlobalOpt/memset.ll test/Transforms/IndVarsSimplify/exit_value_tests.llx git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36065 91177308-0d34-0410-b5e6-96231b3b80d8
66 lines
1.1 KiB
LLVM
66 lines
1.1 KiB
LLVM
; RUN: llvm-upgrade < %s | llvm-as | opt -simplifycfg -adce | llvm-dis | \
|
|
; RUN: not grep {call void %f1}
|
|
; END.
|
|
|
|
declare void %f1()
|
|
declare void %f2()
|
|
declare void %f3()
|
|
declare void %f4()
|
|
|
|
implementation
|
|
|
|
int %test1(int %X, bool %D) {
|
|
E:
|
|
%C = seteq int %X, 0
|
|
br bool %C, label %T, label %F
|
|
T:
|
|
br bool %C, label %B, label %A
|
|
A:
|
|
call void %f1()
|
|
br bool %D, label %T, label %F
|
|
B:
|
|
call void %f2()
|
|
ret int 345
|
|
F:
|
|
call void %f3()
|
|
ret int 123
|
|
}
|
|
|
|
int %test2(int %X, bool %D) {
|
|
E:
|
|
%C = seteq int %X, 0
|
|
br bool %C, label %T, label %F
|
|
T:
|
|
%P = phi bool [true, %E], [%C, %A]
|
|
br bool %P, label %B, label %A
|
|
A:
|
|
call void %f1()
|
|
br bool %D, label %T, label %F
|
|
B:
|
|
call void %f2()
|
|
ret int 345
|
|
F:
|
|
call void %f3()
|
|
ret int 123
|
|
}
|
|
|
|
int %test3(int %X, bool %D, int* %AP, int* %BP) {
|
|
E:
|
|
%C = seteq int %X, 0
|
|
br bool %C, label %T, label %F
|
|
T:
|
|
call void %f3() ;; Inst in block.
|
|
%XX = load int* %AP
|
|
store int %XX, int* %BP
|
|
br bool %C, label %B, label %A
|
|
A:
|
|
call void %f1()
|
|
br bool %D, label %T, label %F
|
|
B:
|
|
call void %f2()
|
|
ret int 345
|
|
F:
|
|
call void %f3()
|
|
ret int 123
|
|
}
|