Skip to content

Final test tweaks for wasm2js #8756

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions emcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1527,6 +1527,8 @@ def check(input_file):
if shared.Settings.WASM2JS:
if not shared.Settings.WASM_BACKEND:
exit_with_error('wasm2js is only available in the upstream wasm backend path')
if use_source_map(options):
exit_with_error('wasm2js does not support source maps yet (debug in wasm for now)')
logger.warning('emcc: JS support in the upstream LLVM+wasm2js path is very experimental currently (best to use fastcomp for asm.js for now)')

# wasm outputs are only possible with a side wasm
Expand Down
14 changes: 13 additions & 1 deletion tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def decorated(self):
self.skipTest('wasm simd not compatible with asm.js or asm2wasm')
if not V8_ENGINE or V8_ENGINE not in JS_ENGINES:
self.skipTest('wasm simd only supported in d8 for now')
if self.get_setting('WASM2JS'):
if self.is_wasm_backend() and not self.get_setting('WASM'):
self.skipTest('wasm2js only supports MVP for now')
self.set_setting('SIMD', 1)
self.emcc_args.append('-fno-lax-vector-conversions')
Expand All @@ -71,6 +71,14 @@ def decorated(f):
return decorated


def no_wasm2js(f):
def decorated(self):
if self.is_wasm_backend() and not self.get_setting('WASM'):
self.skipTest('wasm2js not supported')
f(self)
return decorated


# Async wasm compilation can't work in some tests, they are set up synchronously
def sync(f):
assert callable(f)
Expand Down Expand Up @@ -1863,6 +1871,7 @@ def test_llvmswitch(self):
def test_cxx03_do_run(self):
self.do_run_in_out_file_test('tests', 'core', 'test_cxx03_do_run')

@no_wasm2js # massive switches can break js engines
@no_emterpreter
def test_bigswitch(self):
src = open(path_from_root('tests', 'bigswitch.cpp')).read()
Expand All @@ -1872,6 +1881,7 @@ def test_bigswitch(self):
3060: what?
''', args=['34962', '26214', '35040', str(0xbf4)])

@no_wasm2js # massive switches can break js engines
@no_emterpreter
@is_slow_test
def test_biggerswitch(self):
Expand Down Expand Up @@ -6402,6 +6412,7 @@ def test_emulate_function_pointer_casts(self):
('|1.266,1|', # asm.js, double <-> int
'|1.266,1413754136|')) # wasm, reinterpret the bits

@no_wasm2js # TODO: nicely printed names in wasm2js
def test_demangle_stacks(self):
self.set_setting('DEMANGLE_SUPPORT', 1)
self.set_setting('ASSERTIONS', 1)
Expand Down Expand Up @@ -6780,6 +6791,7 @@ def post(filename):

### Tests for tools

@no_wasm2js # TODO: source maps in wasm2js
@no_emterpreter
def test_source_map(self):
if not jsrun.check_engine(NODE_JS):
Expand Down