aboutsummaryrefslogtreecommitdiffhomepage
path: root/interp/testdata
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2021-10-30 20:04:20 +0200
committerRon Evans <[email protected]>2021-11-02 22:16:15 +0100
commit54dd75f7b3d8e87ee405796242898249575a970e (patch)
tree61a8c5119e8617239c22bbd9396c101667258164 /interp/testdata
parent27cbb5353811bf50043b9616d530593108172be5 (diff)
downloadtinygo-54dd75f7b3d8e87ee405796242898249575a970e.tar.gz
tinygo-54dd75f7b3d8e87ee405796242898249575a970e.zip
interp: simplify pointer arithmetic in getLLVMValue
Instead of doing lots of complicated calculations to get the shortest GEP, I'll just cast it to i8*, do the GEP, and optionally cast to the requested type. This currently produces ugly constant expressions, but once LLVM switches to opaque pointer types all of this shouldn't matter anymore.
Diffstat (limited to 'interp/testdata')
-rw-r--r--interp/testdata/basic.out.ll2
1 files changed, 1 insertions, 1 deletions
diff --git a/interp/testdata/basic.out.ll b/interp/testdata/basic.out.ll
index 174f073eb..9279606e5 100644
--- a/interp/testdata/basic.out.ll
+++ b/interp/testdata/basic.out.ll
@@ -21,7 +21,7 @@ entry:
store i64 %value1, i64* getelementptr inbounds ([4 x i64], [4 x i64]* @main.nonConst1, i32 0, i32 0), align 8
%value2 = load i64, i64* getelementptr inbounds ([4 x i64], [4 x i64]* @main.nonConst1, i32 0, i32 0), align 8
store i64 %value2, i64* @main.nonConst2, align 8
- call void @modifyExternal(i32* getelementptr inbounds ([8 x { i16, i32 }], [8 x { i16, i32 }]* @main.someArray, i32 0, i32 3, i32 1))
+ call void @modifyExternal(i32* bitcast (i8* getelementptr inbounds (i8, i8* bitcast ([8 x { i16, i32 }]* @main.someArray to i8*), i32 28) to i32*))
call void @modifyExternal(i32* bitcast ([1 x i16*]* @main.exportedValue to i32*))
store i16 5, i16* @main.exposedValue1, align 2
call void @modifyExternal(i32* bitcast (void ()* @willModifyGlobal to i32*))