summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2019-04-22 11:36:50 -0700
committerGitHub <noreply@github.com>2019-04-22 11:36:50 -0700
commitf87de2ae0d430f8d4204df8fceb194c24e29b413 (patch)
tree45f601d00a65f3f0424cf3e9777d6b1afc270479 /test
parentb2161e3148e40cec252abb0ef33538b797954579 (diff)
downloadbinaryen-f87de2ae0d430f8d4204df8fceb194c24e29b413.tar.gz
binaryen-f87de2ae0d430f8d4204df8fceb194c24e29b413.tar.bz2
binaryen-f87de2ae0d430f8d4204df8fceb194c24e29b413.zip
wasm-emscripten-finalize: Handle relocatable code in AsmConstWalker (#2035)
When replacing the first argument to an asm call, allow more complex expressions for expressing the address. This fixes the case where the first argument might be the result of adding a constant to __memory_base.
Diffstat (limited to 'test')
-rw-r--r--test/lld/em_asm_O0.wast.out8
-rw-r--r--test/lld/em_asm_shared.wast.out17
2 files changed, 7 insertions, 18 deletions
diff --git a/test/lld/em_asm_O0.wast.out b/test/lld/em_asm_O0.wast.out
index d194c8185..cb5cc1961 100644
--- a/test/lld/em_asm_O0.wast.out
+++ b/test/lld/em_asm_O0.wast.out
@@ -34,16 +34,16 @@
)
)
(local.set $t1
- (i32.const 2)
+ (i32.const 621)
)
(local.set $t2
- (i32.const 1)
+ (i32.const 601)
)
(drop
(call $emscripten_asm_const_ii
- (local.get $t1)
+ (i32.const 2)
(call $emscripten_asm_const_iii
- (local.get $t2)
+ (i32.const 1)
(i32.const 13)
(i32.const 27)
)
diff --git a/test/lld/em_asm_shared.wast.out b/test/lld/em_asm_shared.wast.out
index 220a10aca..3a5268380 100644
--- a/test/lld/em_asm_shared.wast.out
+++ b/test/lld/em_asm_shared.wast.out
@@ -48,12 +48,7 @@
)
(drop
(call $emscripten_asm_const_iii
- (i32.add
- (local.tee $1
- (global.get $gimport$3)
- )
- (i32.const 0)
- )
+ (i32.const 0)
(i32.add
(local.get $0)
(i32.const 24)
@@ -80,10 +75,7 @@
)
(local.tee $2
(call $emscripten_asm_const_iii
- (i32.add
- (local.get $1)
- (i32.const 1)
- )
+ (i32.const 1)
(i32.add
(local.get $0)
(i32.const 24)
@@ -101,10 +93,7 @@
)
(drop
(call $emscripten_asm_const_iii
- (i32.add
- (local.get $1)
- (i32.const 2)
- )
+ (i32.const 2)
(i32.add
(local.get $0)
(i32.const 24)