mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-23 15:29:51 +00:00
e7e5918755
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3439 91177308-0d34-0410-b5e6-96231b3b80d8
47 lines
1.2 KiB
LLVM
47 lines
1.2 KiB
LLVM
; RUN: as < %s > Output/%s.bc
|
|
; RUN: as < testlink2.ll > Output/testlink2.bc
|
|
; RUN: link Output/%s.bc Output/testlink2.bc
|
|
|
|
%MyVar = uninitialized global int
|
|
%MyIntList = global { \2 *, int } { { \2, int }* null, int 17 }
|
|
uninitialized global int ; int*:0
|
|
|
|
%AConst = constant int 123
|
|
|
|
%Intern1 = internal constant int 42
|
|
%Intern2 = internal constant int 792
|
|
|
|
; Initialized to point to external %MyVar
|
|
%MyVarPtr = global { int * } { int * %MyVar }
|
|
|
|
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
|
|
|
|
%idx = getelementptr { \2 *, int }* %MyIntList, uint 0, ubyte 1
|
|
%v2 = load int* %idx
|
|
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
|
|
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
|
|
|