From 6396fe9a0b2cb60cdec787f5faf7c21792ae732f Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Wed, 25 Feb 2026 17:05:59 -0800 Subject: [PATCH] Re-run generate_lld_tests.py. NFC Also, update the script to run against modern emscripten/clang. --- scripts/test/generate_lld_tests.py | 18 ++-- test/lld/basic_safe_stack.wat | 8 +- test/lld/basic_safe_stack.wat.out | 8 +- test/lld/em_asm.wat | 13 +-- test/lld/em_asm.wat.out | 10 +-- test/lld/em_asm64.wat | 16 ++-- test/lld/em_asm64.wat.out | 12 +-- test/lld/em_asm_O0.wat | 13 +-- test/lld/em_asm_O0.wat.out | 10 +-- test/lld/em_asm_shared.wat | 17 ++-- test/lld/em_asm_shared.wat.out | 13 ++- test/lld/hello_world.wat | 13 +-- test/lld/hello_world.wat.out | 10 +-- test/lld/init.wat | 11 +-- test/lld/init.wat.out | 8 +- test/lld/longjmp.wat | 108 +++++++++++------------ test/lld/longjmp.wat.out | 105 +++++++++++------------ test/lld/recursive.wat | 11 +-- test/lld/recursive.wat.out | 8 +- test/lld/reserved_func_ptr.wat | 33 ++++---- test/lld/reserved_func_ptr.wat.out | 30 +++---- test/lld/shared.wat | 14 +-- test/lld/shared.wat.out | 10 +-- test/lld/shared_longjmp.wat | 132 ++++++++++++++--------------- test/lld/shared_longjmp.wat.out | 130 ++++++++++++++-------------- 25 files changed, 371 insertions(+), 390 deletions(-) diff --git a/scripts/test/generate_lld_tests.py b/scripts/test/generate_lld_tests.py index 3593931548a..996758550da 100755 --- a/scripts/test/generate_lld_tests.py +++ b/scripts/test/generate_lld_tests.py @@ -51,13 +51,9 @@ def generate_wat_files(llvm_bin, emscripten_sysroot): is_64 = '64' in src_file compile_cmd = [ - os.path.join(llvm_bin, 'clang'), src_path, '-o', obj_path, + os.path.join(llvm_bin, 'clang'), '-c', src_path, '-o', obj_path, '-mllvm', '-enable-emscripten-sjlj', - '-c', - '-nostdinc', - '-Xclang', '-nobuiltininc', - '-Xclang', '-nostdsysteminc', - '-Xclang', f'-I{emscripten_sysroot}/include' + '--sysroot', emscripten_sysroot, '-O1', ] @@ -68,7 +64,6 @@ def generate_wat_files(llvm_bin, emscripten_sysroot): '--export', '__wasm_call_ctors', '--export', '__start_em_asm', '--export', '__stop_em_asm', - '--global-base=568', ] # We had a regression where this test only worked if debug names # were included. @@ -79,10 +74,13 @@ def generate_wat_files(llvm_bin, emscripten_sysroot): compile_cmd.append('-fvisibility=default') link_cmd.append('-shared') link_cmd.append('--experimental-pic') - elif 'reserved_func_ptr' in src_file: - link_cmd.append('--entry=__main_argc_argv') else: - link_cmd.append('--entry=main') + link_cmd.append('--global-base=568') + link_cmd.append('--no-stack-first') + if 'reserved_func_ptr' in src_file: + link_cmd.append('--entry=__main_argc_argv') + else: + link_cmd.append('--entry=main') if is_64: compile_cmd.append('--target=wasm64-emscripten') diff --git a/test/lld/basic_safe_stack.wat b/test/lld/basic_safe_stack.wat index e82d0a50fa3..a3a03682429 100644 --- a/test/lld/basic_safe_stack.wat +++ b/test/lld/basic_safe_stack.wat @@ -1,7 +1,7 @@ -(module - (type $none_=>_none (func)) - (type $i32_=>_none (func (param i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) +(module $basic_safe_stack.wasm + (type $0 (func)) + (type $1 (func (param i32))) + (type $2 (func (param i32) (result i32))) (global $__stack_pointer (mut i32) (i32.const 66112)) (memory $0 2) (export "memory" (memory $0)) diff --git a/test/lld/basic_safe_stack.wat.out b/test/lld/basic_safe_stack.wat.out index b92a3048c5a..d639a5d9038 100644 --- a/test/lld/basic_safe_stack.wat.out +++ b/test/lld/basic_safe_stack.wat.out @@ -1,7 +1,7 @@ -(module - (type $none_=>_none (func)) - (type $i32_=>_none (func (param i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) +(module $basic_safe_stack.wasm + (type $0 (func)) + (type $1 (func (param i32))) + (type $2 (func (param i32) (result i32))) (type $3 (func (param i32 i32))) (import "env" "__handle_stack_overflow" (func $__handle_stack_overflow (param i32))) (global $__stack_pointer (mut i32) (i32.const 66112)) diff --git a/test/lld/em_asm.wat b/test/lld/em_asm.wat index a18196e3ad7..5c5d2a49ce4 100644 --- a/test/lld/em_asm.wat +++ b/test/lld/em_asm.wat @@ -1,8 +1,8 @@ -(module - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $none_=>_none (func)) - (type $none_=>_i32 (func (result i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) +(module $em_asm.wasm + (type $0 (func (param i32 i32 i32) (result i32))) + (type $1 (func)) + (type $2 (func (result i32))) + (type $3 (func (param i32 i32) (result i32))) (import "env" "emscripten_asm_const_int" (func $emscripten_asm_const_int (param i32 i32 i32) (result i32))) (global $__stack_pointer (mut i32) (i32.const 66208)) (global $global$1 i32 (i32.const 574)) @@ -68,6 +68,7 @@ (func $main (param $0 i32) (param $1 i32) (result i32) (call $__original_main) ) - ;; custom section "producers", size 112 + ;; custom section "producers", size 115 + ;; features section: mutable-globals, nontrapping-float-to-int, bulk-memory, sign-ext, reference-types, multivalue, bulk-memory-opt, call-indirect-overlong ) diff --git a/test/lld/em_asm.wat.out b/test/lld/em_asm.wat.out index 3165aa75a62..e2214d51096 100644 --- a/test/lld/em_asm.wat.out +++ b/test/lld/em_asm.wat.out @@ -1,8 +1,8 @@ -(module - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $none_=>_none (func)) - (type $none_=>_i32 (func (result i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) +(module $em_asm.wasm + (type $0 (func (param i32 i32 i32) (result i32))) + (type $1 (func)) + (type $2 (func (result i32))) + (type $3 (func (param i32 i32) (result i32))) (import "env" "emscripten_asm_const_int" (func $emscripten_asm_const_int (param i32 i32 i32) (result i32))) (global $__stack_pointer (mut i32) (i32.const 66208)) (global $global$1 i32 (i32.const 574)) diff --git a/test/lld/em_asm64.wat b/test/lld/em_asm64.wat index d4ef38506aa..388fd945fc6 100644 --- a/test/lld/em_asm64.wat +++ b/test/lld/em_asm64.wat @@ -1,8 +1,8 @@ -(module - (type $i64_i64_i64_=>_i32 (func (param i64 i64 i64) (result i32))) - (type $none_=>_none (func)) - (type $none_=>_i32 (func (result i32))) - (type $i32_i64_=>_i32 (func (param i32 i64) (result i32))) +(module $em_asm64.wasm + (type $0 (func (param i64 i64 i64) (result i32))) + (type $1 (func)) + (type $2 (func (result i32))) + (type $3 (func (param i32 i64) (result i32))) (import "env" "emscripten_asm_const_int" (func $emscripten_asm_const_int (param i64 i64 i64) (result i32))) (global $__stack_pointer (mut i64) (i64.const 66208)) (global $global$1 i64 (i64.const 574)) @@ -10,7 +10,7 @@ (memory $0 i64 2) (data $.rodata (i64.const 568) "\00ii\00i\00") (data $em_asm (i64.const 574) "{ Module.print(\"Hello world\"); }\00{ return $0 + $1; }\00{ Module.print(\"Got \" + $0); }\00") - (table $0 1 1 funcref) + (table $0 i64 1 1 funcref) (export "memory" (memory $0)) (export "__wasm_call_ctors" (func $__wasm_call_ctors)) (export "main" (func $main)) @@ -68,7 +68,7 @@ (func $main (param $0 i32) (param $1 i64) (result i32) (call $__original_main) ) - ;; custom section "producers", size 112 - ;; features section: memory64 + ;; custom section "producers", size 115 + ;; features section: mutable-globals, nontrapping-float-to-int, bulk-memory, sign-ext, reference-types, multivalue, memory64, bulk-memory-opt, call-indirect-overlong ) diff --git a/test/lld/em_asm64.wat.out b/test/lld/em_asm64.wat.out index 297933163e4..8ccd2ef2706 100644 --- a/test/lld/em_asm64.wat.out +++ b/test/lld/em_asm64.wat.out @@ -1,8 +1,8 @@ -(module - (type $i64_i64_i64_=>_i32 (func (param i64 i64 i64) (result i32))) - (type $none_=>_none (func)) - (type $none_=>_i32 (func (result i32))) - (type $i32_i64_=>_i32 (func (param i32 i64) (result i32))) +(module $em_asm64.wasm + (type $0 (func (param i64 i64 i64) (result i32))) + (type $1 (func)) + (type $2 (func (result i32))) + (type $3 (func (param i32 i64) (result i32))) (import "env" "emscripten_asm_const_int" (func $emscripten_asm_const_int (param i64 i64 i64) (result i32))) (global $__stack_pointer (mut i64) (i64.const 66208)) (global $global$1 i64 (i64.const 574)) @@ -10,7 +10,7 @@ (memory $0 i64 2) (data $.rodata (i64.const 568) "\00ii\00i\00") (data $em_asm (i64.const 574) "{ Module.print(\"Hello world\"); }\00{ return $0 + $1; }\00{ Module.print(\"Got \" + $0); }\00") - (table $0 1 1 funcref) + (table $0 i64 1 1 funcref) (export "memory" (memory $0)) (export "__wasm_call_ctors" (func $__wasm_call_ctors)) (export "main" (func $main)) diff --git a/test/lld/em_asm_O0.wat b/test/lld/em_asm_O0.wat index 1dba1e9ced2..5b56b0570e1 100644 --- a/test/lld/em_asm_O0.wat +++ b/test/lld/em_asm_O0.wat @@ -1,8 +1,8 @@ -(module - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $none_=>_none (func)) - (type $none_=>_i32 (func (result i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) +(module $em_asm_O0.wasm + (type $0 (func (param i32 i32 i32) (result i32))) + (type $1 (func)) + (type $2 (func (result i32))) + (type $3 (func (param i32 i32) (result i32))) (import "env" "emscripten_asm_const_int" (func $emscripten_asm_const_int (param i32 i32 i32) (result i32))) (global $__stack_pointer (mut i32) (i32.const 66192)) (global $global$1 i32 (i32.const 568)) @@ -96,6 +96,7 @@ (func $main (param $0 i32) (param $1 i32) (result i32) (call $__original_main) ) - ;; custom section "producers", size 112 + ;; custom section "producers", size 115 + ;; features section: mutable-globals, nontrapping-float-to-int, bulk-memory, sign-ext, reference-types, multivalue, bulk-memory-opt, call-indirect-overlong ) diff --git a/test/lld/em_asm_O0.wat.out b/test/lld/em_asm_O0.wat.out index 6635354bfb2..54319db7f72 100644 --- a/test/lld/em_asm_O0.wat.out +++ b/test/lld/em_asm_O0.wat.out @@ -1,8 +1,8 @@ -(module - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $none_=>_none (func)) - (type $none_=>_i32 (func (result i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) +(module $em_asm_O0.wasm + (type $0 (func (param i32 i32 i32) (result i32))) + (type $1 (func)) + (type $2 (func (result i32))) + (type $3 (func (param i32 i32) (result i32))) (import "env" "emscripten_asm_const_int" (func $emscripten_asm_const_int (param i32 i32 i32) (result i32))) (global $__stack_pointer (mut i32) (i32.const 66192)) (global $global$1 i32 (i32.const 568)) diff --git a/test/lld/em_asm_shared.wat b/test/lld/em_asm_shared.wat index e4374aa0af8..195ff00ab05 100644 --- a/test/lld/em_asm_shared.wat +++ b/test/lld/em_asm_shared.wat @@ -1,8 +1,8 @@ -(module - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) +(module $em_asm_shared.wasm + (type $0 (func (param i32 i32 i32) (result i32))) + (type $1 (func)) + (type $2 (func (result i32))) + (type $3 (func (param i32 i32) (result i32))) (import "env" "memory" (memory $mimport$0 1)) (import "env" "__indirect_function_table" (table $timport$0 0 funcref)) (import "env" "__stack_pointer" (global $__stack_pointer (mut i32))) @@ -19,7 +19,6 @@ (global $global$4 i32 (i32.const 90)) (data $.data (global.get $__memory_base) "\00ii\00i\00{ Module.print(\"Hello world\"); }\00{ return $0 + $1; }\00{ Module.print(\"Got \" + $0); }\00") (export "__wasm_call_ctors" (func $__wasm_call_ctors)) - (export "__wasm_apply_data_relocs" (func $__wasm_apply_data_relocs)) (export "__original_main" (func $__original_main)) (export "_ZN20__em_asm_sig_builderI19__em_asm_type_tupleIJEEE6bufferE" (global $global$0)) (export "_ZN20__em_asm_sig_builderI19__em_asm_type_tupleIJiiEEE6bufferE" (global $global$1)) @@ -29,8 +28,6 @@ (export "__stop_em_asm" (global $global$4)) (func $__wasm_call_ctors ) - (func $__wasm_apply_data_relocs - ) (func $__original_main (result i32) (local $0 i32) (local $1 i32) @@ -98,7 +95,7 @@ ;; memoryalignment: 0 ;; tablesize: 0 ;; tablealignment: 0 - ;; custom section "producers", size 112 - ;; features section: mutable-globals + ;; custom section "producers", size 115 + ;; features section: mutable-globals, nontrapping-float-to-int, bulk-memory, sign-ext, reference-types, multivalue, bulk-memory-opt, call-indirect-overlong ) diff --git a/test/lld/em_asm_shared.wat.out b/test/lld/em_asm_shared.wat.out index 5b72ac8abee..c045509ccf8 100644 --- a/test/lld/em_asm_shared.wat.out +++ b/test/lld/em_asm_shared.wat.out @@ -1,8 +1,8 @@ -(module - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) +(module $em_asm_shared.wasm + (type $0 (func (param i32 i32 i32) (result i32))) + (type $1 (func)) + (type $2 (func (result i32))) + (type $3 (func (param i32 i32) (result i32))) (import "env" "memory" (memory $mimport$0 1)) (import "env" "__indirect_function_table" (table $timport$0 0 funcref)) (import "env" "__stack_pointer" (global $__stack_pointer (mut i32))) @@ -19,7 +19,6 @@ (global $global$4 i32 (i32.const 90)) (data $.data (global.get $__memory_base) "\00ii\00i\00{ Module.print(\"Hello world\"); }\00{ return $0 + $1; }\00{ Module.print(\"Got \" + $0); }\00") (export "__wasm_call_ctors" (func $__wasm_call_ctors)) - (export "__wasm_apply_data_relocs" (func $__wasm_apply_data_relocs)) (export "__original_main" (func $__original_main)) (export "_ZN20__em_asm_sig_builderI19__em_asm_type_tupleIJEEE6bufferE" (global $global$0)) (export "_ZN20__em_asm_sig_builderI19__em_asm_type_tupleIJiiEEE6bufferE" (global $global$1)) @@ -29,8 +28,6 @@ (export "__stop_em_asm" (global $global$4)) (func $__wasm_call_ctors ) - (func $__wasm_apply_data_relocs - ) (func $__original_main (result i32) (local $0 i32) (local $1 i32) diff --git a/test/lld/hello_world.wat b/test/lld/hello_world.wat index 335bcb865c9..fdbe94f9642 100644 --- a/test/lld/hello_world.wat +++ b/test/lld/hello_world.wat @@ -1,8 +1,8 @@ -(module - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $none_=>_none (func)) - (type $none_=>_i32 (func (result i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) +(module $hello_world.wasm + (type $0 (func (param i32) (result i32))) + (type $1 (func)) + (type $2 (func (result i32))) + (type $3 (func (param i32 i32) (result i32))) (import "env" "puts" (func $puts (param i32) (result i32))) (global $__stack_pointer (mut i32) (i32.const 66128)) (memory $0 2) @@ -24,6 +24,7 @@ (func $main (param $0 i32) (param $1 i32) (result i32) (call $__original_main) ) - ;; custom section "producers", size 112 + ;; custom section "producers", size 115 + ;; features section: mutable-globals, nontrapping-float-to-int, bulk-memory, sign-ext, reference-types, multivalue, bulk-memory-opt, call-indirect-overlong ) diff --git a/test/lld/hello_world.wat.out b/test/lld/hello_world.wat.out index 0e105c4c024..b2fe677ae48 100644 --- a/test/lld/hello_world.wat.out +++ b/test/lld/hello_world.wat.out @@ -1,8 +1,8 @@ -(module - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $none_=>_none (func)) - (type $none_=>_i32 (func (result i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) +(module $hello_world.wasm + (type $0 (func (param i32) (result i32))) + (type $1 (func)) + (type $2 (func (result i32))) + (type $3 (func (param i32 i32) (result i32))) (import "env" "puts" (func $puts (param i32) (result i32))) (global $__stack_pointer (mut i32) (i32.const 66128)) (memory $0 2) diff --git a/test/lld/init.wat b/test/lld/init.wat index ea81a12a55e..fd3f240af57 100644 --- a/test/lld/init.wat +++ b/test/lld/init.wat @@ -1,7 +1,7 @@ -(module - (type $none_=>_none (func)) - (type $none_=>_i32 (func (result i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) +(module $init.wasm + (type $0 (func)) + (type $1 (func (result i32))) + (type $2 (func (param i32 i32) (result i32))) (global $__stack_pointer (mut i32) (i32.const 66112)) (memory $0 2) (table $0 1 1 funcref) @@ -37,6 +37,7 @@ (func $main (param $0 i32) (param $1 i32) (result i32) (call $__original_main) ) - ;; custom section "producers", size 112 + ;; custom section "producers", size 115 + ;; features section: mutable-globals, nontrapping-float-to-int, bulk-memory, sign-ext, reference-types, multivalue, bulk-memory-opt, call-indirect-overlong ) diff --git a/test/lld/init.wat.out b/test/lld/init.wat.out index 68388eecbb9..18a40d94a48 100644 --- a/test/lld/init.wat.out +++ b/test/lld/init.wat.out @@ -1,7 +1,7 @@ -(module - (type $none_=>_none (func)) - (type $none_=>_i32 (func (result i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) +(module $init.wasm + (type $0 (func)) + (type $1 (func (result i32))) + (type $2 (func (param i32 i32) (result i32))) (global $__stack_pointer (mut i32) (i32.const 66112)) (memory $0 2) (table $0 1 1 funcref) diff --git a/test/lld/longjmp.wat b/test/lld/longjmp.wat index 122b6bbc61e..840613abb60 100644 --- a/test/lld/longjmp.wat +++ b/test/lld/longjmp.wat @@ -1,25 +1,20 @@ -(module - (type $none_=>_i32 (func (result i32))) - (type $i32_=>_none (func (param i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) - (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import "env" "malloc" (func $malloc (param i32) (result i32))) - (import "env" "saveSetjmp" (func $saveSetjmp (param i32 i32 i32 i32) (result i32))) - (import "env" "getTempRet0" (func $getTempRet0 (result i32))) +(module $longjmp.wasm + (type $0 (func (param i32 i32 i32))) + (type $1 (func (param i32 i32) (result i32))) + (type $2 (func (result i32))) + (type $3 (func (param i32 i32))) + (type $4 (func (param i32))) + (type $5 (func)) + (import "env" "__wasm_setjmp" (func $__wasm_setjmp (param i32 i32 i32))) (import "env" "emscripten_longjmp" (func $emscripten_longjmp (param i32 i32))) (import "env" "invoke_vii" (func $invoke_vii (param i32 i32 i32))) - (import "env" "testSetjmp" (func $testSetjmp (param i32 i32 i32) (result i32))) + (import "env" "__wasm_setjmp_test" (func $__wasm_setjmp_test (param i32 i32) (result i32))) (import "env" "setTempRet0" (func $setTempRet0 (param i32))) - (import "env" "free" (func $free (param i32))) + (import "env" "getTempRet0" (func $getTempRet0 (result i32))) (global $__stack_pointer (mut i32) (i32.const 66112)) (memory $0 2) (table $0 2 2 funcref) - (elem (i32.const 1) $emscripten_longjmp) + (elem $0 (i32.const 1) $emscripten_longjmp) (export "memory" (memory $0)) (export "__wasm_call_ctors" (func $__wasm_call_ctors)) (export "main" (func $main)) @@ -29,34 +24,30 @@ (local $0 i32) (local $1 i32) (local $2 i32) - (local $3 i32) - (i32.store + (global.set $__stack_pointer (local.tee $0 - (call $malloc - (i32.const 40) + (i32.sub + (global.get $__stack_pointer) + (i32.const 16) ) ) - (i32.const 0) ) - (local.set $1 - (call $saveSetjmp - (local.get $0) - (i32.const 1) + (call $__wasm_setjmp + (local.get $1) + (i32.const 1) + (i32.add (local.get $0) - (i32.const 4) + (i32.const 12) ) ) - (local.set $2 - (call $getTempRet0) - ) - (local.set $0 + (local.set $1 (i32.const 0) ) - (block $label$1 - (block $label$2 - (loop $label$3 - (br_if $label$2 - (local.get $0) + (block $block2 + (block $block + (loop $label + (br_if $block + (local.get $1) ) (i32.store offset=568 (i32.const 0) @@ -64,10 +55,10 @@ ) (call $invoke_vii (i32.const 1) - (local.get $0) + (local.get $1) (i32.const 1) ) - (local.set $0 + (local.set $1 (i32.load offset=568 (i32.const 0) ) @@ -76,61 +67,62 @@ (i32.const 0) (i32.const 0) ) - (block $label$4 - (br_if $label$4 + (block $block1 + (br_if $block1 (i32.eqz - (local.get $0) + (local.get $1) ) ) - (br_if $label$4 + (br_if $block1 (i32.eqz - (local.tee $3 + (local.tee $2 (i32.load offset=572 (i32.const 0) ) ) ) ) - (br_if $label$1 + (br_if $block2 (i32.eqz - (call $testSetjmp - (i32.load + (call $__wasm_setjmp_test + (local.get $1) + (i32.add (local.get $0) + (i32.const 12) ) - (local.get $1) - (local.get $2) ) ) ) (call $setTempRet0 - (local.get $3) + (local.get $2) ) ) - (local.set $0 + (local.set $1 (call $getTempRet0) ) - (br $label$3) + (br $label) ) ) - (call $free - (local.get $1) + (global.set $__stack_pointer + (i32.add + (local.get $0) + (i32.const 16) + ) ) (return (i32.const 0) ) ) - (call $free - (local.get $1) - ) (call $emscripten_longjmp - (local.get $0) - (local.get $3) + (local.get $1) + (local.get $2) ) (unreachable) ) (func $main (param $0 i32) (param $1 i32) (result i32) (call $__original_main) ) - ;; custom section "producers", size 112 + ;; custom section "producers", size 115 + ;; features section: mutable-globals, nontrapping-float-to-int, bulk-memory, sign-ext, reference-types, multivalue, bulk-memory-opt, call-indirect-overlong ) diff --git a/test/lld/longjmp.wat.out b/test/lld/longjmp.wat.out index 508ded29330..165c82e8f7a 100644 --- a/test/lld/longjmp.wat.out +++ b/test/lld/longjmp.wat.out @@ -1,21 +1,16 @@ -(module - (type $none_=>_i32 (func (result i32))) - (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) - (type $i32_=>_none (func (param i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import "env" "malloc" (func $malloc (param i32) (result i32))) - (import "env" "saveSetjmp" (func $saveSetjmp (param i32 i32 i32 i32) (result i32))) - (import "env" "getTempRet0" (func $getTempRet0 (result i32))) +(module $longjmp.wasm + (type $0 (func (param i32 i32 i32))) + (type $3 (func (param i32 i32))) + (type $1 (func (param i32 i32) (result i32))) + (type $2 (func (result i32))) + (type $4 (func (param i32))) + (type $5 (func)) + (import "env" "__wasm_setjmp" (func $__wasm_setjmp (param i32 i32 i32))) (import "env" "emscripten_longjmp" (func $emscripten_longjmp (param i32 i32))) (import "env" "invoke_vii" (func $invoke_vii (param i32 i32 i32))) - (import "env" "testSetjmp" (func $testSetjmp (param i32 i32 i32) (result i32))) + (import "env" "__wasm_setjmp_test" (func $__wasm_setjmp_test (param i32 i32) (result i32))) (import "env" "setTempRet0" (func $setTempRet0 (param i32))) - (import "env" "free" (func $free (param i32))) + (import "env" "getTempRet0" (func $getTempRet0 (result i32))) (global $__stack_pointer (mut i32) (i32.const 66112)) (memory $0 2) (table $0 2 2 funcref) @@ -30,34 +25,30 @@ (local $0 i32) (local $1 i32) (local $2 i32) - (local $3 i32) - (i32.store + (global.set $__stack_pointer (local.tee $0 - (call $malloc - (i32.const 40) + (i32.sub + (global.get $__stack_pointer) + (i32.const 16) ) ) - (i32.const 0) ) - (local.set $1 - (call $saveSetjmp - (local.get $0) - (i32.const 1) + (call $__wasm_setjmp + (local.get $1) + (i32.const 1) + (i32.add (local.get $0) - (i32.const 4) + (i32.const 12) ) ) - (local.set $2 - (call $getTempRet0) - ) - (local.set $0 + (local.set $1 (i32.const 0) ) - (block $label$1 - (block $label$2 - (loop $label$3 - (br_if $label$2 - (local.get $0) + (block $block2 + (block $block + (loop $label + (br_if $block + (local.get $1) ) (i32.store offset=568 (i32.const 0) @@ -65,10 +56,10 @@ ) (call $invoke_vii (i32.const 1) - (local.get $0) + (local.get $1) (i32.const 1) ) - (local.set $0 + (local.set $1 (i32.load offset=568 (i32.const 0) ) @@ -77,55 +68,55 @@ (i32.const 0) (i32.const 0) ) - (block $label$4 - (br_if $label$4 + (block $block1 + (br_if $block1 (i32.eqz - (local.get $0) + (local.get $1) ) ) - (br_if $label$4 + (br_if $block1 (i32.eqz - (local.tee $3 + (local.tee $2 (i32.load offset=572 (i32.const 0) ) ) ) ) - (br_if $label$1 + (br_if $block2 (i32.eqz - (call $testSetjmp - (i32.load + (call $__wasm_setjmp_test + (local.get $1) + (i32.add (local.get $0) + (i32.const 12) ) - (local.get $1) - (local.get $2) ) ) ) (call $setTempRet0 - (local.get $3) + (local.get $2) ) ) - (local.set $0 + (local.set $1 (call $getTempRet0) ) - (br $label$3) + (br $label) ) ) - (call $free - (local.get $1) + (global.set $__stack_pointer + (i32.add + (local.get $0) + (i32.const 16) + ) ) (return (i32.const 0) ) ) - (call $free - (local.get $1) - ) (call $emscripten_longjmp - (local.get $0) - (local.get $3) + (local.get $1) + (local.get $2) ) (unreachable) ) @@ -133,7 +124,7 @@ (call $__original_main) ) (func $dynCall_vii (param $fptr i32) (param $0 i32) (param $1 i32) - (call_indirect (type $i32_i32_=>_none) + (call_indirect (type $3) (local.get $0) (local.get $1) (local.get $fptr) diff --git a/test/lld/recursive.wat b/test/lld/recursive.wat index c9d30aabe56..81e3a4d259e 100644 --- a/test/lld/recursive.wat +++ b/test/lld/recursive.wat @@ -1,7 +1,7 @@ -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_none (func)) - (type $none_=>_i32 (func (result i32))) +(module $recursive.wasm + (type $0 (func (param i32 i32) (result i32))) + (type $1 (func)) + (type $2 (func (result i32))) (import "env" "iprintf" (func $iprintf (param i32 i32) (result i32))) (global $__stack_pointer (mut i32) (i32.const 66128)) (memory $0 2) @@ -81,6 +81,7 @@ (func $main (param $0 i32) (param $1 i32) (result i32) (call $__original_main) ) - ;; custom section "producers", size 112 + ;; custom section "producers", size 115 + ;; features section: mutable-globals, nontrapping-float-to-int, bulk-memory, sign-ext, reference-types, multivalue, bulk-memory-opt, call-indirect-overlong ) diff --git a/test/lld/recursive.wat.out b/test/lld/recursive.wat.out index 47035fe7a06..d63c9d6c7f8 100644 --- a/test/lld/recursive.wat.out +++ b/test/lld/recursive.wat.out @@ -1,7 +1,7 @@ -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_none (func)) - (type $none_=>_i32 (func (result i32))) +(module $recursive.wasm + (type $0 (func (param i32 i32) (result i32))) + (type $1 (func)) + (type $2 (func (result i32))) (import "env" "iprintf" (func $iprintf (param i32 i32) (result i32))) (global $__stack_pointer (mut i32) (i32.const 66128)) (memory $0 2) diff --git a/test/lld/reserved_func_ptr.wat b/test/lld/reserved_func_ptr.wat index 38a7b86050b..e6647642ff8 100644 --- a/test/lld/reserved_func_ptr.wat +++ b/test/lld/reserved_func_ptr.wat @@ -1,16 +1,16 @@ -(module - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_=>_none (func (param i32))) - (type $f32_f32_i32_=>_f32 (func (param f32 f32 i32) (result f32))) - (type $f64_i32_=>_f64 (func (param f64 i32) (result f64))) +(module $reserved_func_ptr.wasm + (type $0 (func (param i32 i32 i32))) + (type $1 (func)) + (type $2 (func (param i32 i32) (result i32))) + (type $3 (func (param i32) (result i32))) + (type $4 (func (param i32))) + (type $5 (func (param f32 f32 i32) (result f32))) + (type $6 (func (param f64 i32) (result f64))) (import "env" "_Z4atoiPKc" (func $atoi\28char\20const*\29 (param i32) (result i32))) (global $__stack_pointer (mut i32) (i32.const 66112)) (memory $0 2) (table $0 3 3 funcref) - (elem (i32.const 1) $address_taken_func\28int\2c\20int\2c\20int\29 $address_taken_func2\28int\2c\20int\2c\20int\29) + (elem $0 (i32.const 1) $address_taken_func\28int\2c\20int\2c\20int\29 $address_taken_func2\28int\2c\20int\2c\20int\29) (export "memory" (memory $0)) (export "__wasm_call_ctors" (func $__wasm_call_ctors)) (export "__main_argc_argv" (func $main)) @@ -60,22 +60,22 @@ ) ) ) - (call_indirect (type $none_=>_none) + (call_indirect $0 (type $1) (local.get $2) ) - (call_indirect (type $i32_=>_none) + (call_indirect $0 (type $4) (i32.const 3) (local.get $3) ) (drop - (call_indirect (type $i32_i32_=>_i32) + (call_indirect $0 (type $2) (i32.const 4) (i32.const 5) (local.get $4) ) ) (drop - (call_indirect (type $f32_f32_i32_=>_f32) + (call_indirect $0 (type $5) (f32.const 3.0999999046325684) (f32.const 4.199999809265137) (i32.const 5) @@ -83,13 +83,13 @@ ) ) (drop - (call_indirect (type $f64_i32_=>_f64) + (call_indirect $0 (type $6) (f64.const 4.2) (i32.const 5) (local.get $1) ) ) - (call_indirect (type $i32_i32_i32_=>_none) + (call_indirect $0 (type $0) (i32.const 1) (i32.const 2) (i32.const 3) @@ -104,6 +104,7 @@ ) (i32.const 0) ) - ;; custom section "producers", size 112 + ;; custom section "producers", size 115 + ;; features section: mutable-globals, nontrapping-float-to-int, bulk-memory, sign-ext, reference-types, multivalue, bulk-memory-opt, call-indirect-overlong ) diff --git a/test/lld/reserved_func_ptr.wat.out b/test/lld/reserved_func_ptr.wat.out index 554d6aa0606..7396c5abb82 100644 --- a/test/lld/reserved_func_ptr.wat.out +++ b/test/lld/reserved_func_ptr.wat.out @@ -1,11 +1,11 @@ -(module - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_=>_none (func (param i32))) - (type $f32_f32_i32_=>_f32 (func (param f32 f32 i32) (result f32))) - (type $f64_i32_=>_f64 (func (param f64 i32) (result f64))) +(module $reserved_func_ptr.wasm + (type $0 (func (param i32 i32 i32))) + (type $1 (func)) + (type $2 (func (param i32 i32) (result i32))) + (type $3 (func (param i32) (result i32))) + (type $4 (func (param i32))) + (type $5 (func (param f32 f32 i32) (result f32))) + (type $6 (func (param f64 i32) (result f64))) (type $7 (func (param i32 i32 i32 i32))) (import "env" "_Z4atoiPKc" (func $atoi\28char\20const*\29 (param i32) (result i32))) (global $__stack_pointer (mut i32) (i32.const 66112)) @@ -62,22 +62,22 @@ ) ) ) - (call_indirect (type $none_=>_none) + (call_indirect (type $1) (local.get $2) ) - (call_indirect (type $i32_=>_none) + (call_indirect (type $4) (i32.const 3) (local.get $3) ) (drop - (call_indirect (type $i32_i32_=>_i32) + (call_indirect (type $2) (i32.const 4) (i32.const 5) (local.get $4) ) ) (drop - (call_indirect (type $f32_f32_i32_=>_f32) + (call_indirect (type $5) (f32.const 3.0999999046325684) (f32.const 4.199999809265137) (i32.const 5) @@ -85,13 +85,13 @@ ) ) (drop - (call_indirect (type $f64_i32_=>_f64) + (call_indirect (type $6) (f64.const 4.2) (i32.const 5) (local.get $1) ) ) - (call_indirect (type $i32_i32_i32_=>_none) + (call_indirect (type $0) (i32.const 1) (i32.const 2) (i32.const 3) @@ -107,7 +107,7 @@ (i32.const 0) ) (func $dynCall_viii (param $fptr i32) (param $0 i32) (param $1 i32) (param $2 i32) - (call_indirect (type $i32_i32_i32_=>_none) + (call_indirect (type $0) (local.get $0) (local.get $1) (local.get $2) diff --git a/test/lld/shared.wat b/test/lld/shared.wat index 5b7574bed23..9a947f78cd8 100644 --- a/test/lld/shared.wat +++ b/test/lld/shared.wat @@ -1,7 +1,7 @@ -(module - (type $none_=>_none (func)) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $none_=>_i32 (func (result i32))) +(module $shared.wasm + (type $0 (func)) + (type $1 (func (param i32) (result i32))) + (type $2 (func (result i32))) (import "env" "memory" (memory $mimport$0 1)) (import "env" "__indirect_function_table" (table $timport$0 0 funcref)) (import "env" "__memory_base" (global $__memory_base i32)) @@ -14,10 +14,10 @@ (global $global$1 i32 (i32.const 20)) (data $.data (global.get $__memory_base) "Hello, world\00\00\00\00\00\00\00\00\00\00\00\00") (export "__wasm_call_ctors" (func $__wasm_call_ctors)) - (export "__wasm_apply_data_relocs" (func $__wasm_apply_data_relocs)) (export "_Z13print_messagev" (func $print_message\28\29)) (export "ptr_puts" (global $global$0)) (export "ptr_local_func" (global $global$1)) + (export "__wasm_apply_data_relocs" (func $__wasm_apply_data_relocs)) (func $__wasm_call_ctors ) (func $__wasm_apply_data_relocs @@ -54,7 +54,7 @@ ;; memoryalignment: 2 ;; tablesize: 0 ;; tablealignment: 0 - ;; custom section "producers", size 112 - ;; features section: mutable-globals + ;; custom section "producers", size 115 + ;; features section: mutable-globals, nontrapping-float-to-int, bulk-memory, sign-ext, reference-types, multivalue, bulk-memory-opt, call-indirect-overlong ) diff --git a/test/lld/shared.wat.out b/test/lld/shared.wat.out index 6ce5b208e86..7c6874d1fc1 100644 --- a/test/lld/shared.wat.out +++ b/test/lld/shared.wat.out @@ -1,7 +1,7 @@ -(module - (type $none_=>_none (func)) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $none_=>_i32 (func (result i32))) +(module $shared.wasm + (type $0 (func)) + (type $1 (func (param i32) (result i32))) + (type $2 (func (result i32))) (import "env" "memory" (memory $mimport$0 1)) (import "env" "__indirect_function_table" (table $timport$0 0 funcref)) (import "env" "__memory_base" (global $__memory_base i32)) @@ -14,10 +14,10 @@ (global $global$1 i32 (i32.const 20)) (data $.data (global.get $__memory_base) "Hello, world\00\00\00\00\00\00\00\00\00\00\00\00") (export "__wasm_call_ctors" (func $__wasm_call_ctors)) - (export "__wasm_apply_data_relocs" (func $__wasm_apply_data_relocs)) (export "_Z13print_messagev" (func $print_message\28\29)) (export "ptr_puts" (global $global$0)) (export "ptr_local_func" (global $global$1)) + (export "__wasm_apply_data_relocs" (func $__wasm_apply_data_relocs)) (func $__wasm_call_ctors ) (func $__wasm_apply_data_relocs diff --git a/test/lld/shared_longjmp.wat b/test/lld/shared_longjmp.wat index d217e6d96e5..15dfaa7abeb 100644 --- a/test/lld/shared_longjmp.wat +++ b/test/lld/shared_longjmp.wat @@ -1,142 +1,142 @@ -(module - (type $none_=>_none (func)) - (type $i32_=>_none (func (param i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) +(module $shared_longjmp.wasm + (type $0 (func)) + (type $1 (func (param i32 i32 i32))) + (type $2 (func (param i32 i32))) + (type $3 (func (param i32 i32) (result i32))) + (type $4 (func (param i32))) + (type $5 (func (result i32))) (import "env" "memory" (memory $mimport$0 1)) (import "env" "__indirect_function_table" (table $timport$0 0 funcref)) + (import "env" "__stack_pointer" (global $__stack_pointer (mut i32))) (import "env" "__memory_base" (global $__memory_base i32)) (import "env" "__table_base" (global $__table_base i32)) (import "GOT.mem" "__THREW__" (global $__THREW__ (mut i32))) (import "GOT.func" "emscripten_longjmp" (global $emscripten_longjmp (mut i32))) (import "GOT.mem" "__threwValue" (global $__threwValue (mut i32))) - (import "env" "malloc" (func $malloc (param i32) (result i32))) - (import "env" "saveSetjmp" (func $saveSetjmp (param i32 i32 i32 i32) (result i32))) - (import "env" "getTempRet0" (func $getTempRet0 (result i32))) + (import "env" "__wasm_setjmp" (func $__wasm_setjmp (param i32 i32 i32))) (import "env" "emscripten_longjmp" (func $emscripten_longjmp (param i32 i32))) (import "env" "invoke_vii" (func $invoke_vii (param i32 i32 i32))) - (import "env" "testSetjmp" (func $testSetjmp (param i32 i32 i32) (result i32))) + (import "env" "__wasm_setjmp_test" (func $__wasm_setjmp_test (param i32 i32) (result i32))) (import "env" "setTempRet0" (func $setTempRet0 (param i32))) - (import "env" "free" (func $free (param i32))) + (import "env" "getTempRet0" (func $getTempRet0 (result i32))) (global $global$0 i32 (i32.const 0)) (global $global$1 i32 (i32.const 4)) - (data $.bss (global.get $__memory_base) "\00\00\00\00\00\00\00\00") (export "__wasm_call_ctors" (func $__wasm_call_ctors)) - (export "__wasm_apply_data_relocs" (func $__wasm_apply_data_relocs)) (export "_start" (func $_start)) (export "__THREW__" (global $global$0)) (export "__threwValue" (global $global$1)) + (start $__wasm_init_memory) (func $__wasm_call_ctors ) - (func $__wasm_apply_data_relocs + (func $__wasm_init_memory + (memory.fill + (i32.add + (i32.const 0) + (global.get $__memory_base) + ) + (i32.const 0) + (i32.const 8) + ) ) (func $_start (local $0 i32) (local $1 i32) (local $2 i32) - (local $3 i32) - (i32.store + (global.set $__stack_pointer (local.tee $0 - (call $malloc - (i32.const 40) + (i32.sub + (global.get $__stack_pointer) + (i32.const 16) ) ) - (i32.const 0) ) - (local.set $1 - (call $saveSetjmp - (local.get $0) - (i32.const 1) + (call $__wasm_setjmp + (local.get $1) + (i32.const 1) + (i32.add (local.get $0) - (i32.const 4) + (i32.const 12) ) ) - (local.set $2 - (call $getTempRet0) - ) - (local.set $0 + (local.set $1 (i32.const 0) ) - (block $label$1 - (block $label$2 - (loop $label$3 - (br_if $label$2 - (local.get $0) + (block $block2 + (block $block + (loop $label + (br_if $block + (local.get $1) ) (i32.store - (local.tee $0 + (local.tee $1 (global.get $__THREW__) ) (i32.const 0) ) (call $invoke_vii (global.get $emscripten_longjmp) - (local.get $0) + (local.get $1) (i32.const 1) ) - (local.set $3 + (local.set $2 (i32.load - (local.get $0) + (local.get $1) ) ) (i32.store - (local.get $0) + (local.get $1) (i32.const 0) ) - (local.set $0 + (local.set $1 (global.get $__threwValue) ) - (block $label$4 - (br_if $label$4 + (block $block1 + (br_if $block1 (i32.eqz - (local.get $3) + (local.get $2) ) ) - (br_if $label$4 + (br_if $block1 (i32.eqz - (local.tee $0 + (local.tee $1 (i32.load - (local.get $0) + (local.get $1) ) ) ) ) - (br_if $label$1 + (br_if $block2 (i32.eqz - (call $testSetjmp - (i32.load - (local.get $3) - ) - (local.get $1) + (call $__wasm_setjmp_test (local.get $2) + (i32.add + (local.get $0) + (i32.const 12) + ) ) ) ) (call $setTempRet0 - (local.get $0) + (local.get $1) ) ) - (local.set $0 + (local.set $1 (call $getTempRet0) ) - (br $label$3) + (br $label) ) ) - (call $free - (local.get $1) + (global.set $__stack_pointer + (i32.add + (local.get $0) + (i32.const 16) + ) ) (return) ) - (call $free - (local.get $1) - ) (call $emscripten_longjmp - (local.get $3) - (local.get $0) + (local.get $2) + (local.get $1) ) (unreachable) ) @@ -145,7 +145,7 @@ ;; memoryalignment: 2 ;; tablesize: 0 ;; tablealignment: 0 - ;; custom section "producers", size 112 - ;; features section: mutable-globals + ;; custom section "producers", size 115 + ;; features section: mutable-globals, nontrapping-float-to-int, bulk-memory, sign-ext, reference-types, multivalue, bulk-memory-opt, call-indirect-overlong ) diff --git a/test/lld/shared_longjmp.wat.out b/test/lld/shared_longjmp.wat.out index 96ef571f779..8b873933bf7 100644 --- a/test/lld/shared_longjmp.wat.out +++ b/test/lld/shared_longjmp.wat.out @@ -1,148 +1,148 @@ -(module - (type $none_=>_none (func)) - (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) - (type $i32_=>_none (func (param i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) +(module $shared_longjmp.wasm + (type $1 (func (param i32 i32 i32))) + (type $0 (func)) + (type $2 (func (param i32 i32))) + (type $3 (func (param i32 i32) (result i32))) + (type $4 (func (param i32))) + (type $5 (func (result i32))) (import "env" "memory" (memory $mimport$0 1)) (import "env" "__indirect_function_table" (table $timport$0 0 funcref)) + (import "env" "__stack_pointer" (global $__stack_pointer (mut i32))) (import "env" "__memory_base" (global $__memory_base i32)) (import "env" "__table_base" (global $__table_base i32)) (import "GOT.mem" "__THREW__" (global $__THREW__ (mut i32))) (import "GOT.func" "emscripten_longjmp" (global $emscripten_longjmp (mut i32))) (import "GOT.mem" "__threwValue" (global $__threwValue (mut i32))) - (import "env" "malloc" (func $malloc (param i32) (result i32))) - (import "env" "saveSetjmp" (func $saveSetjmp (param i32 i32 i32 i32) (result i32))) - (import "env" "getTempRet0" (func $getTempRet0 (result i32))) + (import "env" "__wasm_setjmp" (func $__wasm_setjmp (param i32 i32 i32))) (import "env" "emscripten_longjmp" (func $emscripten_longjmp (param i32 i32))) (import "env" "invoke_vii" (func $invoke_vii (param i32 i32 i32))) - (import "env" "testSetjmp" (func $testSetjmp (param i32 i32 i32) (result i32))) + (import "env" "__wasm_setjmp_test" (func $__wasm_setjmp_test (param i32 i32) (result i32))) (import "env" "setTempRet0" (func $setTempRet0 (param i32))) - (import "env" "free" (func $free (param i32))) + (import "env" "getTempRet0" (func $getTempRet0 (result i32))) (global $global$0 i32 (i32.const 0)) (global $global$1 i32 (i32.const 4)) - (data $.bss (global.get $__memory_base) "\00\00\00\00\00\00\00\00") (export "__wasm_call_ctors" (func $__wasm_call_ctors)) - (export "__wasm_apply_data_relocs" (func $__wasm_apply_data_relocs)) (export "_start" (func $_start)) (export "__THREW__" (global $global$0)) (export "__threwValue" (global $global$1)) (export "dynCall_vii" (func $dynCall_vii)) + (start $__wasm_init_memory) (func $__wasm_call_ctors ) - (func $__wasm_apply_data_relocs + (func $__wasm_init_memory + (memory.fill + (i32.add + (i32.const 0) + (global.get $__memory_base) + ) + (i32.const 0) + (i32.const 8) + ) ) (func $_start (local $0 i32) (local $1 i32) (local $2 i32) - (local $3 i32) - (i32.store + (global.set $__stack_pointer (local.tee $0 - (call $malloc - (i32.const 40) + (i32.sub + (global.get $__stack_pointer) + (i32.const 16) ) ) - (i32.const 0) ) - (local.set $1 - (call $saveSetjmp - (local.get $0) - (i32.const 1) + (call $__wasm_setjmp + (local.get $1) + (i32.const 1) + (i32.add (local.get $0) - (i32.const 4) + (i32.const 12) ) ) - (local.set $2 - (call $getTempRet0) - ) - (local.set $0 + (local.set $1 (i32.const 0) ) - (block $label$1 - (block $label$2 - (loop $label$3 - (br_if $label$2 - (local.get $0) + (block $block2 + (block $block + (loop $label + (br_if $block + (local.get $1) ) (i32.store - (local.tee $0 + (local.tee $1 (global.get $__THREW__) ) (i32.const 0) ) (call $invoke_vii (global.get $emscripten_longjmp) - (local.get $0) + (local.get $1) (i32.const 1) ) - (local.set $3 + (local.set $2 (i32.load - (local.get $0) + (local.get $1) ) ) (i32.store - (local.get $0) + (local.get $1) (i32.const 0) ) - (local.set $0 + (local.set $1 (global.get $__threwValue) ) - (block $label$4 - (br_if $label$4 + (block $block1 + (br_if $block1 (i32.eqz - (local.get $3) + (local.get $2) ) ) - (br_if $label$4 + (br_if $block1 (i32.eqz - (local.tee $0 + (local.tee $1 (i32.load - (local.get $0) + (local.get $1) ) ) ) ) - (br_if $label$1 + (br_if $block2 (i32.eqz - (call $testSetjmp - (i32.load - (local.get $3) - ) - (local.get $1) + (call $__wasm_setjmp_test (local.get $2) + (i32.add + (local.get $0) + (i32.const 12) + ) ) ) ) (call $setTempRet0 - (local.get $0) + (local.get $1) ) ) - (local.set $0 + (local.set $1 (call $getTempRet0) ) - (br $label$3) + (br $label) ) ) - (call $free - (local.get $1) + (global.set $__stack_pointer + (i32.add + (local.get $0) + (i32.const 16) + ) ) (return) ) - (call $free - (local.get $1) - ) (call $emscripten_longjmp - (local.get $3) - (local.get $0) + (local.get $2) + (local.get $1) ) (unreachable) ) (func $dynCall_vii (param $fptr i32) (param $0 i32) (param $1 i32) - (call_indirect (type $i32_i32_=>_none) + (call_indirect (type $2) (local.get $0) (local.get $1) (local.get $fptr)