blob: dd89d8b6960a890b2ecc210ed3f567d4cb92d232 [file] [log] [blame]
Chris Lattnerfce9d702002-08-20 19:32:17 +00001; RUN: as < %s > Output/%s.bc
2; RUN: as < testlink2.ll > Output/testlink2.bc
3; RUN: link Output/%s.bc Output/testlink2.bc
Chris Lattner285c68d2001-10-13 07:15:38 +00004
5%MyVar = uninitialized global int
6%MyIntList = global { \2 *, int } { { \2, int }* null, int 17 }
7 uninitialized global int ; int*:0
8
9%AConst = constant int 123
10
Chris Lattnerb4b07c72001-11-26 19:17:06 +000011%Intern1 = internal constant int 42
12%Intern2 = internal constant int 792
13
Chris Lattner230e5ef2001-10-15 03:11:58 +000014; Initialized to point to external %MyVar
15%MyVarPtr = global { int * } { int * %MyVar }
16
Chris Lattner285c68d2001-10-13 07:15:38 +000017declare int "foo"(int %blah) ;; Declared in testlink2.ll
18
19declare void "print"(int %Value)
20
21implementation
22
23void "main"()
24begin
25 %v1 = load int* %MyVar
26 call void %print(int %v1) ;; Should start out 4
27
Chris Lattnerf493a562001-12-14 16:46:53 +000028 %v2 = load { \2 *, int }* %MyIntList, uint 0, ubyte 1
Chris Lattner285c68d2001-10-13 07:15:38 +000029 call void %print(int %v2) ;; Should start out 17
30
31 call int %foo(int 5) ;; Modify global variablesx
32
33 %v3 = load int* %MyVar
34 call void %print(int %v3) ;; Should now be 5
35
Chris Lattnerf493a562001-12-14 16:46:53 +000036 %v4 = load { \2 *, int }* %MyIntList, uint 0, ubyte 1
Chris Lattner285c68d2001-10-13 07:15:38 +000037 call void %print(int %v4) ;; Should start out 12
38
39 ret void
40end
41
Chris Lattnerb4b07c72001-11-26 19:17:06 +000042internal void "testintern"() begin ret void end
43internal void "Testintern"() begin ret void end
44 void "testIntern"() begin ret void end
45