34
34
from common import env_modify, no_mac, no_windows, only_windows, requires_native_clang, with_env_modify
35
35
from common import create_file, parameterized, NON_ZERO, node_pthreads, TEST_ROOT, test_file
36
36
from common import compiler_for, EMBUILDER, requires_v8, requires_node, requires_wasm64, requires_node_canary
37
- from common import requires_wasm_eh , crossplatform, with_all_eh_sjlj, with_all_sjlj
37
+ from common import requires_wasm_exnref , crossplatform, with_all_eh_sjlj, with_all_sjlj
38
38
from common import also_with_standalone_wasm, also_with_env_modify, also_with_wasm2js
39
39
from common import also_with_minimal_runtime, also_with_wasm_bigint, also_with_wasm64, flaky
40
40
from common import EMTEST_BUILD_VERBOSE, PYTHON, WEBIDL_BINDER
@@ -3295,13 +3295,19 @@ def test_embind_tsgen_memory64(self):
3295
3295
self.get_emcc_args())
3296
3296
self.assertFileContents(test_file('other/embind_tsgen_memory64.d.ts'), read_file('embind_tsgen_memory64.d.ts'))
3297
3297
3298
- def test_embind_tsgen_exceptions(self):
3298
+ @parameterized({
3299
+ '': [0],
3300
+ 'wasm_exnref': [1]
3301
+ })
3302
+ def test_embind_tsgen_exceptions(self, wasm_exnref):
3303
+ self.set_setting('WASM_EXNREF', wasm_exnref)
3299
3304
# Check that when Wasm exceptions and assertions are enabled bindings still generate.
3300
3305
self.run_process([EMXX, test_file('other/embind_tsgen.cpp'),
3301
3306
'-lembind', '-fwasm-exceptions', '-sASSERTIONS',
3302
3307
# Use the deprecated `--embind-emit-tsd` to ensure it
3303
3308
# still works until removed.
3304
- '--embind-emit-tsd', 'embind_tsgen.d.ts', '-Wno-deprecated'])
3309
+ '--embind-emit-tsd', 'embind_tsgen.d.ts', '-Wno-deprecated'] +
3310
+ self.get_emcc_args())
3305
3311
self.assertFileContents(test_file('other/embind_tsgen.d.ts'), read_file('embind_tsgen.d.ts'))
3306
3312
3307
3313
def test_embind_jsgen_method_pointer_stability(self):
@@ -8529,6 +8535,7 @@ def test_metadce_minimal_pthreads(self):
8529
8535
'-sDEMANGLE_SUPPORT', '-Wno-deprecated'], [], ['waka']), # noqa
8530
8536
# Wasm EH's code size increase is smaller than that of Emscripten EH
8531
8537
'except_wasm': (['-O2', '-fwasm-exceptions'], [], ['waka']), # noqa
8538
+ 'except_wasm_exnref': (['-O2', '-fwasm-exceptions', '-sWASM_EXNREF'], [], ['waka']), # noqa
8532
8539
# eval_ctors 1 can partially optimize, but runs into getenv() for locale
8533
8540
# code. mode 2 ignores those and fully optimizes out the ctors
8534
8541
'ctors1': (['-O2', '-sEVAL_CTORS'], [], ['waka']), # noqa
@@ -8828,7 +8835,8 @@ def test_lto(self, args):
8828
8835
@parameterized({
8829
8836
'noexcept': [],
8830
8837
'except': ['-sDISABLE_EXCEPTION_CATCHING=0'],
8831
- 'except_wasm': ['-fwasm-exceptions']
8838
+ 'except_wasm': ['-fwasm-exceptions'],
8839
+ 'except_wasm_exnref': ['-fwasm-exceptions', '-sWASM_EXNREF']
8832
8840
})
8833
8841
def test_lto_libcxx(self, *args):
8834
8842
self.run_process([EMXX, test_file('hello_libcxx.cpp'), '-flto'] + list(args))
@@ -8847,11 +8855,14 @@ def test_lto_flags(self):
8847
8855
8848
8856
# We have LTO tests covered in 'wasmltoN' targets in test_core.py, but they
8849
8857
# don't run as a part of Emscripten CI, so we add a separate LTO test here.
8850
- @requires_wasm_eh
8858
+ @requires_wasm_exnref
8851
8859
def test_lto_wasm_exceptions(self):
8852
8860
self.set_setting('EXCEPTION_DEBUG')
8853
8861
self.emcc_args += ['-fwasm-exceptions', '-flto']
8854
8862
self.do_run_in_out_file_test('core/test_exceptions.cpp', out_suffix='_caught')
8863
+ # New Wasm EH with exnref
8864
+ self.set_setting('WASM_EXNREF')
8865
+ self.do_run_in_out_file_test('core/test_exceptions.cpp', out_suffix='_caught')
8855
8866
8856
8867
@parameterized({
8857
8868
'': ([],),
@@ -12267,13 +12278,16 @@ def test_standalone_export_main(self):
12267
12278
# We should consider making this a warning since the `_main` export is redundant.
12268
12279
self.run_process([EMCC, '-sEXPORTED_FUNCTIONS=_main', '-sSTANDALONE_WASM', test_file('core/test_hello_world.c')])
12269
12280
12270
- @requires_wasm_eh
12281
+ @requires_wasm_exnref
12271
12282
def test_standalone_wasm_exceptions(self):
12272
12283
self.set_setting('STANDALONE_WASM')
12273
12284
self.set_setting('WASM_BIGINT')
12274
12285
self.wasm_engines = []
12275
12286
self.emcc_args += ['-fwasm-exceptions']
12276
12287
self.do_run_in_out_file_test('core/test_exceptions.cpp', out_suffix='_caught')
12288
+ # New Wasm EH with exnref
12289
+ self.set_setting('WASM_EXNREF')
12290
+ self.do_run_in_out_file_test('core/test_exceptions.cpp', out_suffix='_caught')
12277
12291
12278
12292
def test_missing_malloc_export(self):
12279
12293
# we used to include malloc by default. show a clear error in builds with
0 commit comments