rename *.llx -> *.ll, last batch.
[oota-llvm.git] / test / Transforms / GlobalOpt / malloc-promote-3.ll
1 ; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep malloc
2
3 @G = internal global i32* null          ; <i32**> [#uses=4]
4
5 define void @init() {
6         %P = malloc i32, i32 100                ; <i32*> [#uses=1]
7         store i32* %P, i32** @G
8         %GV = load i32** @G             ; <i32*> [#uses=1]
9         %GVe = getelementptr i32* %GV, i32 40           ; <i32*> [#uses=1]
10         store i32 20, i32* %GVe
11         ret void
12 }
13
14 define i32 @get() {
15         %GV = load i32** @G             ; <i32*> [#uses=1]
16         %GVe = getelementptr i32* %GV, i32 40           ; <i32*> [#uses=1]
17         %V = load i32* %GVe             ; <i32> [#uses=1]
18         ret i32 %V
19 }
20
21 define i1 @check() {
22         %GV = load i32** @G             ; <i32*> [#uses=1]
23         %V = icmp eq i32* %GV, null             ; <i1> [#uses=1]
24         ret i1 %V
25 }
26