3535from common import env_modify, no_mac, no_windows, only_windows, requires_native_clang, with_env_modify
3636from common import create_file, parameterized, NON_ZERO, node_pthreads, TEST_ROOT, test_file
3737from common import compiler_for, EMBUILDER, requires_v8, requires_node, requires_wasm64, requires_node_canary
38- from common import requires_wasm_exnref , crossplatform, with_all_eh_sjlj, with_all_sjlj
38+ from common import requires_wasm_eh , crossplatform, with_all_eh_sjlj, with_all_sjlj
3939from common import also_with_standalone_wasm, also_with_wasm2js, also_with_noderawfs, also_with_wasmfs
4040from common import also_with_minimal_runtime, also_with_wasm_bigint, also_with_wasm64, flaky
4141from common import EMTEST_BUILD_VERBOSE, PYTHON, WEBIDL_BINDER
@@ -3539,7 +3539,7 @@ def test_embind_tsgen_jspi(self):
35393539 'wasm_exnref': [1]
35403540 })
35413541 def test_embind_tsgen_exceptions(self, wasm_exnref):
3542- self.set_setting('WASM_EXNREF ', wasm_exnref)
3542+ self.set_setting('WASM_LEGACY_EXCEPTIONS ', wasm_exnref == 1 )
35433543 # Check that when Wasm exceptions and assertions are enabled bindings still generate.
35443544 self.run_process([EMXX, test_file('other/embind_tsgen.cpp'),
35453545 '-lembind', '-fwasm-exceptions', '-sASSERTIONS',
@@ -8928,8 +8928,8 @@ def test_codesize_minimal_pthreads(self):
89288928 'mangle': (['-O2', '-fexceptions',
89298929 '-sDEMANGLE_SUPPORT', '-Wno-deprecated'], [], ['waka']), # noqa
89308930 # Wasm EH's code size increase is smaller than that of Emscripten EH
8931- 'except_wasm': (['-O2', '-fwasm-exceptions'], [], ['waka']),
8932- 'except_wasm_exnref': (['-O2', '-fwasm-exceptions', '-sWASM_EXNREF '], [], ['waka']),
8931+ 'except_wasm': (['-O2', '-fwasm-exceptions', '-sWASM_LEGACY_EXCEPTIONS' ], [], ['waka']),
8932+ 'except_wasm_exnref': (['-O2', '-fwasm-exceptions', '-sWASM_LEGACY_EXCEPTIONS=0 '], [], ['waka']),
89338933 # eval_ctors 1 can partially optimize, but runs into getenv() for locale
89348934 # code. mode 2 ignores those and fully optimizes out the ctors
89358935 'ctors1': (['-O2', '-sEVAL_CTORS'], [], ['waka']),
@@ -9230,8 +9230,8 @@ def test_lto(self, args):
92309230 @parameterized({
92319231 'noexcept': [],
92329232 'except': ['-sDISABLE_EXCEPTION_CATCHING=0'],
9233- 'except_wasm': ['-fwasm-exceptions'],
9234- 'except_wasm_exnref': ['-fwasm-exceptions', '-sWASM_EXNREF ']
9233+ 'except_wasm': ['-fwasm-exceptions', '-sWASM_LEGACY_EXCEPTIONS' ],
9234+ 'except_wasm_exnref': ['-fwasm-exceptions', '-sWASM_LEGACY_EXCEPTIONS=0 ']
92359235 })
92369236 def test_lto_libcxx(self, *args):
92379237 self.run_process([EMXX, test_file('hello_libcxx.cpp'), '-flto'] + list(args))
@@ -9250,13 +9250,14 @@ def test_lto_flags(self):
92509250
92519251 # We have LTO tests covered in 'wasmltoN' targets in test_core.py, but they
92529252 # don't run as a part of Emscripten CI, so we add a separate LTO test here.
9253- @requires_wasm_exnref
9253+ @requires_wasm_eh
92549254 def test_lto_wasm_exceptions(self):
92559255 self.set_setting('EXCEPTION_DEBUG')
9256+ self.set_setting('WASM_LEGACY_EXCEPTIONS')
92569257 self.emcc_args += ['-fwasm-exceptions', '-flto']
92579258 self.do_run_in_out_file_test('core/test_exceptions.cpp', out_suffix='_caught')
92589259 # New Wasm EH with exnref
9259- self.set_setting('WASM_EXNREF' )
9260+ self.set_setting('WASM_LEGACY_EXCEPTIONS', 0 )
92609261 self.do_run_in_out_file_test('core/test_exceptions.cpp', out_suffix='_caught')
92619262
92629263 @parameterized({
@@ -9319,7 +9320,7 @@ def test_exceptions_stack_trace_and_message(self):
93199320 # optional 'traceStack' option in WebAssembly.Exception constructor
93209321 # (https://developer.mozilla.org/en-US/docs/WebAssembly/JavaScript_interface/Exception/Exception)
93219322 # and embeds stack traces unconditionally. Change this back to
9322- # self.require_wasm_eh () if this issue is fixed later.
9323+ # self.require_wasm_legacy_eh () if this issue is fixed later.
93239324 self.require_v8()
93249325
93259326 # Stack traces are enabled when either of ASSERTIONS or
@@ -9360,7 +9361,7 @@ def test_exceptions_rethrow_stack_trace_and_message(self):
93609361 # optional 'traceStack' option in WebAssembly.Exception constructor
93619362 # (https://developer.mozilla.org/en-US/docs/WebAssembly/JavaScript_interface/Exception/Exception)
93629363 # and embeds stack traces unconditionally. Change this back to
9363- # self.require_wasm_eh () if this issue is fixed later.
9364+ # self.require_wasm_legacy_eh () if this issue is fixed later.
93649365 self.require_v8()
93659366 # Rethrowing exception currently loses the stack trace before the rethrowing
93669367 # due to how rethrowing is implemented. So in the examples below we don't
@@ -12761,15 +12762,16 @@ def test_standalone_export_main(self):
1276112762 # We should consider making this a warning since the `_main` export is redundant.
1276212763 self.run_process([EMCC, '-sEXPORTED_FUNCTIONS=_main', '-sSTANDALONE_WASM', test_file('core/test_hello_world.c')])
1276312764
12764- @requires_wasm_exnref
12765+ @requires_wasm_eh
1276512766 def test_standalone_wasm_exceptions(self):
1276612767 self.set_setting('STANDALONE_WASM')
1276712768 self.set_setting('WASM_BIGINT')
1276812769 self.wasm_engines = []
1276912770 self.emcc_args += ['-fwasm-exceptions']
12771+ self.set_setting('WASM_LEGACY_EXCEPTIONS')
1277012772 self.do_run_in_out_file_test('core/test_exceptions.cpp', out_suffix='_caught')
1277112773 # New Wasm EH with exnref
12772- self.set_setting('WASM_EXNREF' )
12774+ self.set_setting('WASM_LEGACY_EXCEPTIONS', 0 )
1277312775 self.do_run_in_out_file_test('core/test_exceptions.cpp', out_suffix='_caught')
1277412776
1277512777 def test_missing_malloc_export(self):
@@ -15310,8 +15312,8 @@ def test_SUPPORT_BIG_ENDIAN(self):
1531015312 'noexcept': ['-fno-exceptions'],
1531115313 'default': [],
1531215314 'except': ['-sDISABLE_EXCEPTION_CATCHING=0'],
15313- 'except_wasm': ['-fwasm-exceptions'],
15314- 'except_wasm_exnref': ['-fwasm-exceptions', '-sWASM_EXNREF ']
15315+ 'except_wasm': ['-fwasm-exceptions', '-sWASM_LEGACY_EXCEPTIONS' ],
15316+ 'except_wasm_exnref': ['-fwasm-exceptions', '-sWASM_LEGACY_EXCEPTIONS=0 ']
1531515317 })
1531615318 def test_std_promise_link(self, *args):
1531715319 # Regression test for a bug where std::promise's destructor caused a link
0 commit comments