summaryrefslogtreecommitdiff
path: root/test/Transforms/DeadStoreElimination/context-sensitive.llx
blob: 54396d48ba1a9c9600a7a0242280cbe95b25a5a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
; RUN: llvm-upgrade < %s | llvm-as | opt -dse | llvm-dis | not grep DEAD

declare void %ext() 

int* %caller() {
	%P = malloc int
	%DEAD = load int* %P
	%DEAD2 = add int %DEAD, 1
	store int %DEAD2, int* %P  ;; dead store

	call void %ext()         ; Can not clobber *P

	store int 0, int* %P
	ret int* %P
}