Skip to content

Commit c4f1a1e

Browse files
authored
Add jsmathz test suite, and skip tests that are failing in it. (#25163)
Add jsmathz test suite, and skip tests that are failing in it. #25162
1 parent 075fcb1 commit c4f1a1e

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

test/test_core.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ def decorated(self, textdecoder, *args, **kwargs):
390390
no_strict_js = make_no_decorator_for_setting('STRICT_JS')
391391
no_big_endian = make_no_decorator_for_setting('SUPPORT_BIG_ENDIAN')
392392
no_omit_asm_module_exports = make_no_decorator_for_setting('DECLARE_ASM_MODULE_EXPORTS=0')
393+
no_js_math = make_no_decorator_for_setting('JS_MATH')
393394

394395

395396
def is_sanitizing(args):
@@ -880,6 +881,7 @@ def test_stack_placement(self):
880881
@no_sanitize('sanitizers do not yet support dynamic linking')
881882
@no_wasm2js('MAIN_MODULE support')
882883
@needs_dylink
884+
@no_js_math('JS_MATH is not compatible with MAIN_MODULE')
883885
def test_stack_placement_pic(self):
884886
self.set_setting('STACK_SIZE', 1024)
885887
self.set_setting('MAIN_MODULE')
@@ -1002,6 +1004,7 @@ def test_longjmp2(self):
10021004

10031005
@needs_dylink
10041006
@with_all_sjlj
1007+
@no_js_math('JS_MATH is not compatible with MAIN_MODULE')
10051008
def test_longjmp2_main_module(self):
10061009
# Test for binaryen regression:
10071010
# https://github.com/WebAssembly/binaryen/issues/2180
@@ -1830,6 +1833,7 @@ def test_set_align(self):
18301833
self.do_core_test('test_set_align.c')
18311834

18321835
@no_modularize_instance('uses Module object directly')
1836+
@no_js_math('JS_MATH is not compatible with LINKABLE')
18331837
def test_emscripten_api(self):
18341838
self.set_setting('EXPORTED_FUNCTIONS', ['_main', '_save_me_aimee'])
18351839
self.do_core_test('test_emscripten_api.c')
@@ -2998,6 +3002,7 @@ def build_dlfcn_lib(self, filename, outfile='liblib.so', cflags=None):
29983002
self.run_process(cmd)
29993003

30003004
@needs_dylink
3005+
@no_js_math('JS_MATH is not compatible with MAIN_MODULE')
30013006
def test_dlfcn_missing(self):
30023007
self.set_setting('MAIN_MODULE')
30033008
self.set_setting('ASSERTIONS')
@@ -3422,6 +3427,7 @@ def test_dlfcn_alignment_and_zeroing(self):
34223427
self.do_runf('src.c', 'success.\n')
34233428

34243429
@needs_dylink
3430+
@no_js_math('JS_MATH is not compatible with MAIN_MODULE')
34253431
def test_dlfcn_self(self):
34263432
self.set_setting('MAIN_MODULE')
34273433
self.set_setting('EXPORT_ALL')
@@ -3807,6 +3813,7 @@ def zzztest_dlfcn_exceptions(self):
38073813
''')
38083814

38093815
@needs_dylink
3816+
@no_js_math('JS_MATH is not compatible with MAIN_MODULE')
38103817
def test_dlfcn_handle_alloc(self):
38113818
# verify that dlopen does not allocate already used handles
38123819
dirname = self.get_dir()
@@ -4614,6 +4621,7 @@ def test_dylink_global_var(self):
46144621
''', expected=['extern is 123.\n'], force_c=True)
46154622

46164623
@needs_dylink
4624+
@no_js_math('JS_MATH is not compatible with MAIN_MODULE')
46174625
def test_dylink_global_var_export(self):
46184626
self.do_run(r'''
46194627
#include <assert.h>
@@ -4790,6 +4798,7 @@ def test_dylink_postsets_chunking(self):
47904798
'missing': ('libc,libmalloc,libc++abi', False, False, False),
47914799
'missing_assertions': ('libc,libmalloc,libc++abi', False, False, True),
47924800
})
4801+
@no_js_math('JS_MATH is not compatible with SIDE_MODULE')
47934802
def test_dylink_syslibs(self, syslibs, expect_pass=True, with_reversed=True, assertions=True):
47944803
# When testing in WASMFS mode, we also need to force the WASMFS syslib into the test.
47954804
if self.get_setting('WASMFS') and syslibs != '1':
@@ -4980,6 +4989,7 @@ def test_dylink_exceptions_try_catch_2(self):
49804989

49814990
@with_all_eh_sjlj
49824991
@needs_dylink
4992+
@no_js_math('JS_MATH is not compatible with MAIN_MODULE')
49834993
def test_dylink_exceptions_try_catch_6(self):
49844994
create_file('main.cpp', r'''
49854995
#include <dlfcn.h>
@@ -5131,6 +5141,7 @@ def test_dylink_load_compiled_side_module(self):
51315141
''', expected=['sidef: 10'])
51325142

51335143
@needs_dylink
5144+
@no_js_math('JS_MATH is not compatible with SIDE_MODULE')
51345145
def test_dylink_dso_needed(self):
51355146
def do_run(src, expected_output, cflags=None):
51365147
create_file('main.c', src + 'int main() { return test_main(); }')
@@ -6314,6 +6325,7 @@ def test_netinet_in(self):
63146325
self.do_run_in_out_file_test('netinet/in.cpp')
63156326

63166327
@needs_dylink
6328+
@no_js_math('JS_MATH is not compatible with MAIN_MODULE')
63176329
def test_main_module_static_align(self):
63186330
if self.get_setting('ALLOW_MEMORY_GROWTH'):
63196331
self.skipTest('no shared modules with memory growth')
@@ -9499,6 +9511,7 @@ def test_pthread_dylink_longjmp(self):
94999511

95009512
@needs_dylink
95019513
@node_pthreads
9514+
@no_js_math('JS_MATH is not compatible with MAIN_MODULE')
95029515
def test_pthread_dylink_main_module_1(self):
95039516
# TODO: For some reason, -lhtml5 must be passed in -sSTRICT mode, but can NOT
95049517
# be passed when not compiling in -sSTRICT mode. That does not seem intentional?
@@ -9675,6 +9688,7 @@ def test_stress_proxy_to_pthread_hello_world(self):
96759688
self.parallel_stress_test_js_file(js_file, assert_returncode=0, expected='hello, world!', not_expected='error')
96769689

96779690
@needs_dylink
9691+
@no_js_math('JS_MATH is not compatible with MAIN_MODULE')
96789692
def test_gl_main_module(self):
96799693
# TODO: For some reason, -lGL must be passed in -sSTRICT mode, but can NOT
96809694
# be passed when not compiling in -sSTRICT mode. That does not seem intentional?
@@ -10095,5 +10109,7 @@ def setUp(self):
1009510109

1009610110
omitexports0 = make_run('omitexports0', cflags=['-O0'], settings={'DECLARE_ASM_MODULE_EXPORTS': 0})
1009710111

10112+
jsmathz = make_run('jsmathz', cflags=['-Oz'], settings={'JS_MATH': 1})
10113+
1009810114
# TestCoreBase is just a shape for the specific subclasses, we don't test it itself
1009910115
del TestCoreBase # noqa

tools/link.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,6 +1088,14 @@ def limit_incoming_module_api():
10881088

10891089
# Use settings
10901090

1091+
if settings.JS_MATH:
1092+
if settings.MAIN_MODULE == 1:
1093+
exit_with_error('JS_MATH is not compatible with dynamic linking (MAIN_MODULE=1)')
1094+
if settings.SIDE_MODULE:
1095+
exit_with_error('JS_MATH is not compatible with dynamic linking (SIDE_MODULE)')
1096+
if settings.LINKABLE:
1097+
exit_with_error('JS_MATH is not compatible with dynamic linking (LINKABLE)')
1098+
10911099
if settings.WASM == 2 and settings.SINGLE_FILE:
10921100
exit_with_error('cannot have both WASM=2 and SINGLE_FILE enabled at the same time')
10931101

0 commit comments

Comments
 (0)