blob: 85ce6bdbc862db6bb1af1e1e9c9471559b8c4ea3 [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; RUN: llvm-upgrade < %s | llvm-as | opt -globalopt | llvm-dis | not grep malloc
2
3%G = internal global int* null
4
5void %init() {
6 %P = malloc int, uint 100
7 store int* %P, int** %G
8
9 %GV = load int** %G
10 %GVe = getelementptr int* %GV, int 40
11 store int 20, int* %GVe
12 ret void
13}
14
15int %get() {
16 %GV = load int** %G
17 %GVe = getelementptr int* %GV, int 40
18 %V = load int* %GVe
19 ret int %V
20}
21
22bool %check() { ;; Return true if init has been called
23 %GV = load int** %G
24 %V = seteq int* %GV, null
25 ret bool %V
26}