llvm.org GIT mirror llvm / 285c68d
Test files for linker git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@783 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 18 years ago
2 changed file(s) with 47 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0
1 %MyVar = uninitialized global int
2 %MyIntList = global { \2 *, int } { { \2, int }* null, int 17 }
3 uninitialized global int ; int*:0
4
5 %AConst = constant int 123
6
7 declare int "foo"(int %blah) ;; Declared in testlink2.ll
8
9 declare void "print"(int %Value)
10
11 implementation
12
13 void "main"()
14 begin
15 %v1 = load int* %MyVar
16 call void %print(int %v1) ;; Should start out 4
17
18 %v2 = load { \2 *, int }* %MyIntList, ubyte 1
19 call void %print(int %v2) ;; Should start out 17
20
21 call int %foo(int 5) ;; Modify global variablesx
22
23 %v3 = load int* %MyVar
24 call void %print(int %v3) ;; Should now be 5
25
26 %v4 = load { \2 *, int }* %MyIntList, ubyte 1
27 call void %print(int %v4) ;; Should start out 12
28
29 ret void
30 end
31
0
1 %MyVar = global int 4
2 %MyIntList = uninitialized global { \2 *, int }
3
4 %AConst = constant int 123
5
6 implementation
7
8 int "foo"(int %blah)
9 begin
10 store int %blah, int *%MyVar
11 store int 12, { \2 *, int } * %MyIntList, ubyte 1
12 ret int %blah
13 end
14