mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 11:13:28 +01:00
New testcase that functions with dynamic allocas can be inlined, and are
inlined correctly. llvm-svn: 25287
This commit is contained in:
parent
423aeb28d5
commit
77ea183840
28
test/Regression/Transforms/Inline/dynamic_alloca_test.ll
Normal file
28
test/Regression/Transforms/Inline/dynamic_alloca_test.ll
Normal file
@ -0,0 +1,28 @@
|
||||
; Test that functions with dynamic allocas get inlined in a case where
|
||||
; naively inlining it would result in a miscompilation.
|
||||
|
||||
; RUN: llvm-as < %s | opt -inline &&
|
||||
; RUN: llvm-as < %s | opt -inline | llvm-dis | grep llvm.stacksave &&
|
||||
; RUN: llvm-as < %s | 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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user