summaryrefslogtreecommitdiff
path: root/test/Analysis/BasicAA/tailcall-modref.ll
blob: c58ad7ffcd4c320cb52c0d05f1ec5dfed38ef5bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
; RUN: llvm-as < %s | opt -basicaa -load-vn -gcse -instcombine | llvm-dis | grep 'ret int 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
}