Use the llvm-upgrade program to upgrade llvm assembly.
[oota-llvm.git] / test / Transforms / GlobalOpt / storepointer-compare.llx
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -globalopt | llvm-dis | grep 'call void %Actual'
2
3 ; Check that a comparison does not prevent an indirect call from being made 
4 ; direct.  The global will still remain, but indirect call elim is still good.
5
6 %G = internal global void ()* null
7
8 implementation
9
10 internal void %Actual() {
11         ret void
12 }
13
14 void %init() {
15         store void()* %Actual, void()** %G
16         ret void
17 }
18
19 void %doit() {
20         %FP = load void()** %G
21         %CC = seteq void()* %FP, null
22         br bool %CC, label %isNull, label %DoCall
23 DoCall:
24         call void %FP()
25         ret void
26 isNull:
27         ret void
28 }