blob: 35ded4f0d763c4c33b8c2280f59b9942027bc1da [file] [log] [blame]
Chris Lattner03ef2fc2003-05-29 15:16:10 +00001; This test ensures that alloca instructions in the entry block for an inlined
2; function are moved to the top of the function they are inlined into.
3;
Reid Spencerd0e30dc2006-12-02 04:23:10 +00004; RUN: llvm-upgrade < %s | llvm-as | opt -inline | llvm-dis | %prcontext alloca 1 | grep Entry:
Chris Lattner03ef2fc2003-05-29 15:16:10 +00005
6int %func(int %i) {
7 %X = alloca int
Chris Lattner84890d22006-09-15 16:53:11 +00008 store int %i, int* %X
Chris Lattner03ef2fc2003-05-29 15:16:10 +00009 ret int %i
10}
11
12declare void %bar()
13
14int %main(int %argc) {
15Entry:
16 call void %bar()
17 %X = call int %func(int 7)
18 %Y = add int %X, %argc
19 ret int %Y
20}