summaryrefslogtreecommitdiff
path: root/test/Transforms/GlobalOpt/storepointer-compare.llx
blob: a6e8ea3d2ee986ef9b3ebd99b4e8e9df8ee59c36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
; RUN: llvm-as < %s | opt -globalopt | llvm-dis | grep 'call void %Actual'

; Check that a comparison does not prevent an indirect call from being made 
; direct.  The global will still remain, but indirect call elim is still good.

%G = internal global void ()* null

implementation

internal void %Actual() {
	ret void
}

void %init() {
	store void()* %Actual, void()** %G
	ret void
}

void %doit() {
	%FP = load void()** %G
	%CC = seteq void()* %FP, null
	br bool %CC, label %isNull, label %DoCall
DoCall:
	call void %FP()
	ret void
isNull:
	ret void
}