summaryrefslogtreecommitdiffstats
path: root/test/Analysis/BasicAA/tailcall-modref.ll
blob: 9d447d91000666eb28699d5be3ac0711a7a2785d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
; RUN: llvm-upgrade < %s | llvm-as | opt -basicaa -load-vn -gcse -instcombine |\
; RUN:   llvm-dis | grep {ret i32 0}
declare void %foo(int*)
declare void %bar()

int %test() {
	%A = alloca int
	call void %foo(int* %A)

	%X = load int* %A
	tail call void %bar()   ;; Cannot modify *%A because it's on the stack.
	%Y = load int* %A
	%Z = sub int %X, %Y
	ret int %Z
}