summaryrefslogtreecommitdiff
path: root/scripts/test/wasm2asm.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2018-02-20 19:28:23 -0800
committerGitHub <noreply@github.com>2018-02-20 19:28:23 -0800
commit5578bb58402fde2bb2c932bfa08ab71045854a41 (patch)
treea547cf74eeaa60dd430de091fcae0a3eab8999a9 /scripts/test/wasm2asm.py
parenteacd9a987750ae3984c225a73e9567931277d6a0 (diff)
downloadbinaryen-5578bb58402fde2bb2c932bfa08ab71045854a41.tar.gz
binaryen-5578bb58402fde2bb2c932bfa08ab71045854a41.tar.bz2
binaryen-5578bb58402fde2bb2c932bfa08ab71045854a41.zip
wasm2asm fixes (#1436)
* don't look for asm.js compilation message if almost asm * fix wasm2asm f32 operations
Diffstat (limited to 'scripts/test/wasm2asm.py')
-rwxr-xr-xscripts/test/wasm2asm.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/scripts/test/wasm2asm.py b/scripts/test/wasm2asm.py
index 35c0d4b8c..6e6b32c81 100755
--- a/scripts/test/wasm2asm.py
+++ b/scripts/test/wasm2asm.py
@@ -55,14 +55,16 @@ def test_wasm2asm_output():
fail_if_not_identical(out, '')
if MOZJS:
- # verify asm.js validates
- # check only subset of err because mozjs emits timing info
- out = run_command([MOZJS, '-w', 'a.2asm.js'],
- expected_err='Successfully compiled asm.js code',
- err_contains=True)
- fail_if_not_identical(out, '')
- out = run_command([MOZJS, 'a.2asm.asserts.js'], expected_err='')
- fail_if_not_identical(out, '')
+ # verify asm.js validates, if this is asm.js code (we emit
+ # almost-asm instead when we need to)
+ if 'use asm' in open('a.2asm.js').read():
+ # check only subset of err because mozjs emits timing info
+ out = run_command([MOZJS, '-w', 'a.2asm.js'],
+ expected_err='Successfully compiled asm.js code',
+ err_contains=True)
+ fail_if_not_identical(out, '')
+ out = run_command([MOZJS, 'a.2asm.asserts.js'], expected_err='')
+ fail_if_not_identical(out, '')
def test_asserts_output():