Fixing a typo in configure.ac.
[oota-llvm.git] / test / Transforms / Inline / dynamic_alloca_test.ll
1 ; Test that functions with dynamic allocas get inlined in a case where
2 ; naively inlining it would result in a miscompilation.
3
4 ; RUN: llvm-upgrade < %s | llvm-as | opt -inline | llvm-dis | \
5 ; RUN:   grep llvm.stacksave
6 ; RUN: llvm-upgrade < %s | llvm-as | opt -inline | llvm-dis | not grep callee
7
8 declare void %ext(int*)
9 implementation
10
11 internal void %callee(uint %N) {
12         %P = alloca int, uint %N     ;; dynamic alloca
13         call void %ext(int* %P)
14         ret void
15 }
16
17 void %foo(uint %N) {
18         br label %Loop
19 Loop:
20         %count = phi uint [0, %0], [%next, %Loop]
21         %next = add uint %count, 1
22         call void %callee(uint %N)
23         %cond = seteq uint %count, 100000
24         br bool %cond, label %out, label %Loop
25 out:
26         ret void
27 }
28