@@ -3298,13 +3298,16 @@ def test_embind_tsgen_memory64(self):
3298
3298
self.assertFileContents(test_file('other/embind_tsgen_memory64.d.ts'), read_file('embind_tsgen_memory64.d.ts'))
3299
3299
3300
3300
def test_embind_tsgen_exceptions(self):
3301
- # Check that when Wasm exceptions and assertions are enabled bindings still generate.
3302
- self.run_process([EMXX, test_file('other/embind_tsgen.cpp'),
3303
- '-lembind', '-fwasm-exceptions', '-sASSERTIONS',
3304
- # Use the deprecated `--embind-emit-tsd` to ensure it
3305
- # still works until removed.
3306
- '--embind-emit-tsd', 'embind_tsgen.d.ts', '-Wno-deprecated'])
3307
- self.assertFileContents(test_file('other/embind_tsgen.d.ts'), read_file('embind_tsgen.d.ts'))
3301
+ for wasm_exnref in [0, 1]:
3302
+ self.set_setting('WASM_EXNREF', wasm_exnref)
3303
+ # Check that when Wasm exceptions and assertions are enabled bindings still generate.
3304
+ self.run_process([EMXX, test_file('other/embind_tsgen.cpp'),
3305
+ '-lembind', '-fwasm-exceptions', '-sASSERTIONS',
3306
+ # Use the deprecated `--embind-emit-tsd` to ensure it
3307
+ # still works until removed.
3308
+ '--embind-emit-tsd', 'embind_tsgen.d.ts', '-Wno-deprecated']
3309
+ + self.get_emcc_args())
3310
+ self.assertFileContents(test_file('other/embind_tsgen.d.ts'), read_file('embind_tsgen.d.ts'))
3308
3311
3309
3312
def test_embind_jsgen_method_pointer_stability(self):
3310
3313
self.emcc_args += ['-lembind', '-sEMBIND_AOT']
@@ -8531,6 +8534,7 @@ def test_metadce_minimal_pthreads(self):
8531
8534
'-sDEMANGLE_SUPPORT', '-Wno-deprecated'], [], ['waka']), # noqa
8532
8535
# Wasm EH's code size increase is smaller than that of Emscripten EH
8533
8536
'except_wasm': (['-O2', '-fwasm-exceptions'], [], ['waka']), # noqa
8537
+ 'except_wasm_exnref': (['-O2', '-fwasm-exceptions', '-sWASM_EXNREF'], [], ['waka']), # noqa
8534
8538
# eval_ctors 1 can partially optimize, but runs into getenv() for locale
8535
8539
# code. mode 2 ignores those and fully optimizes out the ctors
8536
8540
'ctors1': (['-O2', '-sEVAL_CTORS'], [], ['waka']), # noqa
@@ -8830,7 +8834,8 @@ def test_lto(self, args):
8830
8834
@parameterized({
8831
8835
'noexcept': [],
8832
8836
'except': ['-sDISABLE_EXCEPTION_CATCHING=0'],
8833
- 'except_wasm': ['-fwasm-exceptions']
8837
+ 'except_wasm': ['-fwasm-exceptions'],
8838
+ 'except_wasm_exnref': ['-fwasm-exceptions', '-sWASM_EXNREF']
8834
8839
})
8835
8840
def test_lto_libcxx(self, *args):
8836
8841
self.run_process([EMXX, test_file('hello_libcxx.cpp'), '-flto'] + list(args))
@@ -8849,11 +8854,15 @@ def test_lto_flags(self):
8849
8854
8850
8855
# We have LTO tests covered in 'wasmltoN' targets in test_core.py, but they
8851
8856
# don't run as a part of Emscripten CI, so we add a separate LTO test here.
8852
- @requires_wasm_eh
8853
8857
def test_lto_wasm_exceptions(self):
8854
8858
self.set_setting('EXCEPTION_DEBUG')
8859
+ self.require_wasm_eh()
8855
8860
self.emcc_args += ['-fwasm-exceptions', '-flto']
8856
8861
self.do_run_in_out_file_test('core/test_exceptions.cpp', out_suffix='_caught')
8862
+ # New Wasm EH with exnref
8863
+ self.require_wasm_exnref()
8864
+ self.set_setting('WASM_EXNREF')
8865
+ self.do_run_in_out_file_test('core/test_exceptions.cpp', out_suffix='_caught')
8857
8866
8858
8867
@parameterized({
8859
8868
'': ([],),
@@ -12269,12 +12278,16 @@ def test_standalone_export_main(self):
12269
12278
# We should consider making this a warning since the `_main` export is redundant.
12270
12279
self.run_process([EMCC, '-sEXPORTED_FUNCTIONS=_main', '-sSTANDALONE_WASM', test_file('core/test_hello_world.c')])
12271
12280
12272
- @requires_wasm_eh
12273
12281
def test_standalone_wasm_exceptions(self):
12274
12282
self.set_setting('STANDALONE_WASM')
12275
12283
self.set_setting('WASM_BIGINT')
12276
12284
self.wasm_engines = []
12277
12285
self.emcc_args += ['-fwasm-exceptions']
12286
+ self.require_wasm_eh()
12287
+ self.do_run_in_out_file_test('core/test_exceptions.cpp', out_suffix='_caught')
12288
+ # New Wasm EH with exnref
12289
+ self.require_wasm_exnref()
12290
+ self.set_setting('WASM_EXNREF')
12278
12291
self.do_run_in_out_file_test('core/test_exceptions.cpp', out_suffix='_caught')
12279
12292
12280
12293
def test_missing_malloc_export(self):
0 commit comments