2003-05-29 15:16:10 +00:00
|
|
|
; 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.
|
|
|
|
;
|
2004-08-02 22:31:58 +00:00
|
|
|
; RUN: llvm-as < %s | opt -inline | llvm-dis | %prcontext alloca 1 | grep Entry:
|
2003-05-29 15:16:10 +00:00
|
|
|
|
|
|
|
int %func(int %i) {
|
|
|
|
%X = alloca int
|
2006-09-15 16:53:11 +00:00
|
|
|
store int %i, int* %X
|
2003-05-29 15:16:10 +00:00
|
|
|
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
|
|
|
|
}
|