blob: df89d84c17faa37b59342dcb969d045687e3d1f3 [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; RUN: llvm-upgrade < %s | llvm-as > %t.bc
2; RUN: llvm-upgrade < %p/testlink2.ll | llvm-as > %t2.bc
3; RUN: llvm-link %t.bc %t2.bc
4
5%MyVar = external global int
6%MyIntList = global { \2 *, int } { { \2, int }* null, int 17 }
7 external global int ; int*:0
8
9%Inte = global int 1
10
11%AConst = linkonce constant int 123
12
13%Intern1 = internal constant int 42
14%Intern2 = internal constant int 792
15
16; Initialized to point to external %MyVar
17%MyVarPtr = linkonce global { int * } { int * %MyVar }
18
19declare int "foo"(int %blah) ;; Declared in testlink2.ll
20
21declare void "print"(int %Value)
22
23implementation
24
25void "main"()
26begin
27 %v1 = load int* %MyVar
28 call void %print(int %v1) ;; Should start out 4
29
30 %idx = getelementptr { \2 *, int }* %MyIntList, long 0, uint 1
31 %v2 = load int* %idx
32 call void %print(int %v2) ;; Should start out 17
33
34 call int %foo(int 5) ;; Modify global variablesx
35
36 %v3 = load int* %MyVar
37 call void %print(int %v3) ;; Should now be 5
38
39 %v4 = load int* %idx
40 call void %print(int %v4) ;; Should start out 12
41
42 ret void
43end
44
45internal void "testintern"() begin ret void end
46internal void "Testintern"() begin ret void end
47 void "testIntern"() begin ret void end
48