summaryrefslogtreecommitdiff
path: root/test/Transforms/Inline/alloca_test.ll
blob: 35ded4f0d763c4c33b8c2280f59b9942027bc1da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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
}