35
35
from common import env_modify, no_mac, no_windows, only_windows, requires_native_clang, with_env_modify
36
36
from common import create_file, parameterized, NON_ZERO, node_pthreads, TEST_ROOT, test_file
37
37
from 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
39
39
from common import also_with_standalone_wasm, also_with_wasm2js, also_with_noderawfs, also_with_wasmfs
40
40
from common import also_with_minimal_runtime, also_with_wasm_bigint, also_with_wasm64, flaky
41
41
from common import EMTEST_BUILD_VERBOSE, PYTHON, WEBIDL_BINDER
@@ -3539,7 +3539,7 @@ def test_embind_tsgen_jspi(self):
3539
3539
'wasm_exnref': [1]
3540
3540
})
3541
3541
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 )
3543
3543
# Check that when Wasm exceptions and assertions are enabled bindings still generate.
3544
3544
self.run_process([EMXX, test_file('other/embind_tsgen.cpp'),
3545
3545
'-lembind', '-fwasm-exceptions', '-sASSERTIONS',
@@ -8928,8 +8928,8 @@ def test_codesize_minimal_pthreads(self):
8928
8928
'mangle': (['-O2', '-fexceptions',
8929
8929
'-sDEMANGLE_SUPPORT', '-Wno-deprecated'], [], ['waka']), # noqa
8930
8930
# 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']),
8933
8933
# eval_ctors 1 can partially optimize, but runs into getenv() for locale
8934
8934
# code. mode 2 ignores those and fully optimizes out the ctors
8935
8935
'ctors1': (['-O2', '-sEVAL_CTORS'], [], ['waka']),
@@ -9230,8 +9230,8 @@ def test_lto(self, args):
9230
9230
@parameterized({
9231
9231
'noexcept': [],
9232
9232
'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 ']
9235
9235
})
9236
9236
def test_lto_libcxx(self, *args):
9237
9237
self.run_process([EMXX, test_file('hello_libcxx.cpp'), '-flto'] + list(args))
@@ -9250,13 +9250,14 @@ def test_lto_flags(self):
9250
9250
9251
9251
# We have LTO tests covered in 'wasmltoN' targets in test_core.py, but they
9252
9252
# 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
9254
9254
def test_lto_wasm_exceptions(self):
9255
9255
self.set_setting('EXCEPTION_DEBUG')
9256
+ self.set_setting('WASM_LEGACY_EXCEPTIONS')
9256
9257
self.emcc_args += ['-fwasm-exceptions', '-flto']
9257
9258
self.do_run_in_out_file_test('core/test_exceptions.cpp', out_suffix='_caught')
9258
9259
# New Wasm EH with exnref
9259
- self.set_setting('WASM_EXNREF' )
9260
+ self.set_setting('WASM_LEGACY_EXCEPTIONS', 0 )
9260
9261
self.do_run_in_out_file_test('core/test_exceptions.cpp', out_suffix='_caught')
9261
9262
9262
9263
@parameterized({
@@ -9319,7 +9320,7 @@ def test_exceptions_stack_trace_and_message(self):
9319
9320
# optional 'traceStack' option in WebAssembly.Exception constructor
9320
9321
# (https://developer.mozilla.org/en-US/docs/WebAssembly/JavaScript_interface/Exception/Exception)
9321
9322
# 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.
9323
9324
self.require_v8()
9324
9325
9325
9326
# Stack traces are enabled when either of ASSERTIONS or
@@ -9360,7 +9361,7 @@ def test_exceptions_rethrow_stack_trace_and_message(self):
9360
9361
# optional 'traceStack' option in WebAssembly.Exception constructor
9361
9362
# (https://developer.mozilla.org/en-US/docs/WebAssembly/JavaScript_interface/Exception/Exception)
9362
9363
# 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.
9364
9365
self.require_v8()
9365
9366
# Rethrowing exception currently loses the stack trace before the rethrowing
9366
9367
# due to how rethrowing is implemented. So in the examples below we don't
@@ -12761,15 +12762,16 @@ def test_standalone_export_main(self):
12761
12762
# We should consider making this a warning since the `_main` export is redundant.
12762
12763
self.run_process([EMCC, '-sEXPORTED_FUNCTIONS=_main', '-sSTANDALONE_WASM', test_file('core/test_hello_world.c')])
12763
12764
12764
- @requires_wasm_exnref
12765
+ @requires_wasm_eh
12765
12766
def test_standalone_wasm_exceptions(self):
12766
12767
self.set_setting('STANDALONE_WASM')
12767
12768
self.set_setting('WASM_BIGINT')
12768
12769
self.wasm_engines = []
12769
12770
self.emcc_args += ['-fwasm-exceptions']
12771
+ self.set_setting('WASM_LEGACY_EXCEPTIONS')
12770
12772
self.do_run_in_out_file_test('core/test_exceptions.cpp', out_suffix='_caught')
12771
12773
# New Wasm EH with exnref
12772
- self.set_setting('WASM_EXNREF' )
12774
+ self.set_setting('WASM_LEGACY_EXCEPTIONS', 0 )
12773
12775
self.do_run_in_out_file_test('core/test_exceptions.cpp', out_suffix='_caught')
12774
12776
12775
12777
def test_missing_malloc_export(self):
@@ -15310,8 +15312,8 @@ def test_SUPPORT_BIG_ENDIAN(self):
15310
15312
'noexcept': ['-fno-exceptions'],
15311
15313
'default': [],
15312
15314
'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 ']
15315
15317
})
15316
15318
def test_std_promise_link(self, *args):
15317
15319
# Regression test for a bug where std::promise's destructor caused a link
0 commit comments