1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-30 07:22:55 +01:00
llvm-mirror/test/Regression/Linker/testlink1.ll

47 lines
1.2 KiB
LLVM
Raw Normal View History

; RUN: llvm-as < %s > %t.bc
; RUN: llvm-as < `dirname %s`/testlink2.ll > %t2.bc
; RUN: llvm-link %t.bc %t2.bc
2001-10-13 09:15:38 +02:00
2003-04-21 23:06:25 +02:00
%MyVar = external global int
2001-10-13 09:15:38 +02:00
%MyIntList = global { \2 *, int } { { \2, int }* null, int 17 }
2003-04-21 23:06:25 +02:00
external global int ; int*:0
2001-10-13 09:15:38 +02:00
%AConst = linkonce constant int 123
2001-10-13 09:15:38 +02:00
%Intern1 = internal constant int 42
%Intern2 = internal constant int 792
; Initialized to point to external %MyVar
%MyVarPtr = linkonce global { int * } { int * %MyVar }
2001-10-13 09:15:38 +02:00
declare int "foo"(int %blah) ;; Declared in testlink2.ll
declare void "print"(int %Value)
implementation
void "main"()
begin
%v1 = load int* %MyVar
call void %print(int %v1) ;; Should start out 4
2003-04-21 23:06:25 +02:00
%idx = getelementptr { \2 *, int }* %MyIntList, long 0, ubyte 1
%v2 = load int* %idx
2001-10-13 09:15:38 +02:00
call void %print(int %v2) ;; Should start out 17
call int %foo(int 5) ;; Modify global variablesx
%v3 = load int* %MyVar
call void %print(int %v3) ;; Should now be 5
%v4 = load int* %idx
2001-10-13 09:15:38 +02:00
call void %print(int %v4) ;; Should start out 12
ret void
end
internal void "testintern"() begin ret void end
internal void "Testintern"() begin ret void end
void "testIntern"() begin ret void end