mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-24 06:30:19 +00:00
28beeeac4d
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41097 91177308-0d34-0410-b5e6-96231b3b80d8
17 lines
445 B
LLVM
17 lines
445 B
LLVM
; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=powerpc64-apple-darwin | grep extsw | count 2
|
|
|
|
%lens = external global ubyte*
|
|
%vals = external global int*
|
|
|
|
int %test(int %i) {
|
|
%tmp = load ubyte** %lens
|
|
%tmp1 = getelementptr ubyte* %tmp, int %i
|
|
%tmp = load ubyte* %tmp1
|
|
%tmp2 = cast ubyte %tmp to int
|
|
%tmp3 = load int** %vals
|
|
%tmp5 = sub int 1, %tmp2
|
|
%tmp6 = getelementptr int* %tmp3, int %tmp5
|
|
%tmp7 = load int* %tmp6
|
|
ret int %tmp7
|
|
}
|