Another testcase for constness linkage
[oota-llvm.git] / test / Linker / testlink1.ll
1 ; RUN: llvm-as < %s > %t.bc
2 ; RUN: llvm-as < `dirname %s`/testlink2.ll > %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 %AConst    = constant int 123
10
11 %Intern1   = internal constant int 42
12 %Intern2   = internal constant int 792
13
14 ; Initialized to point to external %MyVar
15 %MyVarPtr  = linkonce global { int * }  { int * %MyVar }
16
17 declare int "foo"(int %blah)      ;; Declared in testlink2.ll
18
19 declare void "print"(int %Value)
20
21 implementation
22
23 void "main"()
24 begin
25         %v1 = load int* %MyVar
26         call void %print(int %v1)    ;; Should start out 4
27
28         %idx = getelementptr { \2 *, int }* %MyIntList, long 0, ubyte 1
29         %v2 = load int* %idx
30         call void %print(int %v2)    ;; Should start out 17
31
32         call int %foo(int 5)         ;; Modify global variablesx
33
34         %v3 = load int* %MyVar
35         call void %print(int %v3)    ;; Should now be 5
36
37         %v4 = load int* %idx
38         call void %print(int %v4)    ;; Should start out 12
39
40         ret void
41 end
42
43 internal void "testintern"() begin ret void end
44 internal void "Testintern"() begin ret void end
45          void "testIntern"() begin ret void end
46