summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/lit/wasm-emscripten-finalize/passive-pic.wat2
-rw-r--r--test/lld/em_asm_main_thread.wat2
-rw-r--r--test/lld/em_asm_main_thread.wat.out4
-rw-r--r--test/unit/input/em_asm_mangled_string.wat11
-rw-r--r--test/unit/test_finalize.py10
5 files changed, 7 insertions, 22 deletions
diff --git a/test/lit/wasm-emscripten-finalize/passive-pic.wat b/test/lit/wasm-emscripten-finalize/passive-pic.wat
index 14e6842a3..8b6ccb6d4 100644
--- a/test/lit/wasm-emscripten-finalize/passive-pic.wat
+++ b/test/lit/wasm-emscripten-finalize/passive-pic.wat
@@ -12,6 +12,8 @@
(import "env" "__memory_base" (global $__memory_base i32))
(import "env" "emscripten_asm_const_int" (func $emscripten_asm_const_int (param i32 i32 i32) (result i32)))
(data passive "xxxhello\00yyy")
+ (global (export "__start_em_asm") i32 (i32.const 3))
+ (global (export "__stop_em_asm") i32 (i32.const 9))
;; memory init function similar to those generated by wasm-ld
(start $__wasm_init_memory)
(func $__wasm_init_memory
diff --git a/test/lld/em_asm_main_thread.wat b/test/lld/em_asm_main_thread.wat
index 0435e9be0..65f530d69 100644
--- a/test/lld/em_asm_main_thread.wat
+++ b/test/lld/em_asm_main_thread.wat
@@ -12,6 +12,8 @@
(import "env" "emscripten_asm_const_int_sync_on_main_thread" (func $emscripten_asm_const_int_sync_on_main_thread (param i32 i32 i32) (result i32)))
(memory $0 2)
(data (i32.const 568) "{ Module.print(\"Hello world\"); }\00{ return $0 + $1; }\00{ Module.print(\"Got \" + $0); }\00")
+ (global (export "__start_em_asm") i32 (i32.const 568))
+ (global (export "__stop_em_asm") i32 (i32.const 652))
(table $0 1 1 funcref)
(global $global$0 (mut i32) (i32.const 66192))
(global $global$1 i32 (i32.const 66192))
diff --git a/test/lld/em_asm_main_thread.wat.out b/test/lld/em_asm_main_thread.wat.out
index 8fc99e081..91a022dbc 100644
--- a/test/lld/em_asm_main_thread.wat.out
+++ b/test/lld/em_asm_main_thread.wat.out
@@ -8,8 +8,10 @@
(type $0 (func (param i32 i32 i32) (result i32)))
(import "env" "emscripten_asm_const_int_sync_on_main_thread" (func $emscripten_asm_const_int_sync_on_main_thread (param i32 i32 i32) (result i32)))
(memory $0 2)
- (data (i32.const 568) "{ Module.print(\"Hello world\"); }\00{ return $0 + $1; }\00{ Module.print(\"Got \" + $0); }\00")
+ (data (i32.const 568) "")
(table $0 1 1 funcref)
+ (global $0 i32 (i32.const 568))
+ (global $1 i32 (i32.const 652))
(global $global$0 (mut i32) (i32.const 66192))
(global $global$1 i32 (i32.const 66192))
(global $global$2 i32 (i32.const 652))
diff --git a/test/unit/input/em_asm_mangled_string.wat b/test/unit/input/em_asm_mangled_string.wat
deleted file mode 100644
index aa856270d..000000000
--- a/test/unit/input/em_asm_mangled_string.wat
+++ /dev/null
@@ -1,11 +0,0 @@
-(module
- (import "env" "emscripten_asm_const_int" (func $emscripten_asm_const_int (param i32 i32 i32) (result i32)))
- (global $global$0 (mut i32) (i32.const 66192))
- (global $global$1 i32 (i32.const 652))
- (export "__data_end" (global $global$1))
- (export "main" (func $main))
- (func $main (param $0 i32) (param $1 i32) (result i32)
- (drop (call $emscripten_asm_const_int (local.get $0) (i32.const 0) (i32.const 0)))
- (i32.const 0)
- )
-)
diff --git a/test/unit/test_finalize.py b/test/unit/test_finalize.py
index b393177bd..6733155cb 100644
--- a/test/unit/test_finalize.py
+++ b/test/unit/test_finalize.py
@@ -1,18 +1,8 @@
-import os
-
from scripts.test import shared
from . import utils
class EmscriptenFinalizeTest(utils.BinaryenTestCase):
- def test_em_asm_mangled_string(self):
- p = shared.run_process(shared.WASM_EMSCRIPTEN_FINALIZE + [
- self.input_path('em_asm_mangled_string.wat'), '-o', os.devnull, '--global-base=1024'
- ], check=False, capture_output=True)
- self.assertNotEqual(p.returncode, 0)
- self.assertIn('Fatal: local.get of unknown in arg0 of call to emscripten_asm_const_int (used by EM_ASM* macros) in function main.', p.stderr)
- self.assertIn('This might be caused by aggressive compiler transformations. Consider using EM_JS instead.', p.stderr)
-
def do_output_test(self, args):
# without any output file specified, don't error, don't write the wasm,
# but do emit metadata