mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-21 03:29:40 +00:00
Remove && from the end of the lines to prevent tests from throwing run lines into the background. Also, clean up places where the same command is run multiple times by using a temporary file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36142 91177308-0d34-0410-b5e6-96231b3b80d8
29 lines
694 B
LLVM
29 lines
694 B
LLVM
; Test that functions with dynamic allocas get inlined in a case where
|
|
; naively inlining it would result in a miscompilation.
|
|
|
|
; RUN: llvm-upgrade < %s | llvm-as | opt -inline | llvm-dis | \
|
|
; RUN: grep llvm.stacksave
|
|
; RUN: llvm-upgrade < %s | llvm-as | opt -inline | llvm-dis | not grep callee
|
|
|
|
declare void %ext(int*)
|
|
implementation
|
|
|
|
internal void %callee(uint %N) {
|
|
%P = alloca int, uint %N ;; dynamic alloca
|
|
call void %ext(int* %P)
|
|
ret void
|
|
}
|
|
|
|
void %foo(uint %N) {
|
|
br label %Loop
|
|
Loop:
|
|
%count = phi uint [0, %0], [%next, %Loop]
|
|
%next = add uint %count, 1
|
|
call void %callee(uint %N)
|
|
%cond = seteq uint %count, 100000
|
|
br bool %cond, label %out, label %Loop
|
|
out:
|
|
ret void
|
|
}
|
|
|