diff options
Diffstat (limited to 'llvm/test/Transforms/Inline/alloca_test.ll')
-rw-r--r-- | llvm/test/Transforms/Inline/alloca_test.ll | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/test/Transforms/Inline/alloca_test.ll b/llvm/test/Transforms/Inline/alloca_test.ll new file mode 100644 index 00000000000..35ded4f0d76 --- /dev/null +++ b/llvm/test/Transforms/Inline/alloca_test.ll @@ -0,0 +1,20 @@ +; This test ensures that alloca instructions in the entry block for an inlined +; function are moved to the top of the function they are inlined into. +; +; RUN: llvm-upgrade < %s | llvm-as | opt -inline | llvm-dis | %prcontext alloca 1 | grep Entry: + +int %func(int %i) { + %X = alloca int + store int %i, int* %X + ret int %i +} + +declare void %bar() + +int %main(int %argc) { +Entry: + call void %bar() + %X = call int %func(int 7) + %Y = add int %X, %argc + ret int %Y +} |