diff options
author | Derek Schuff <dschuff@chromium.org> | 2016-09-15 15:49:03 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-15 15:49:03 -0700 |
commit | 22548bf789359be1f3c14aa41ffd4a23fda38542 (patch) | |
tree | e8a1d214c85309010229f4d70a9d553586ba47c6 /scripts/support.py | |
parent | e567fa8675831e79f855cea2181fa58beb107e42 (diff) | |
download | binaryen-22548bf789359be1f3c14aa41ffd4a23fda38542.tar.gz binaryen-22548bf789359be1f3c14aa41ffd4a23fda38542.tar.bz2 binaryen-22548bf789359be1f3c14aa41ffd4a23fda38542.zip |
Update s2wasm for 0xc changes (#698)
Several updates for s2wasm and its tests:
Add explicit drops where they are emitted by LLVM already
Convert loops (which are still modeled in the old way by LLVM) to wrap them in an explicit block (for the exit label). This also allows simplifying the loop creation (no need to post-process the implicit block which is the loop's body). After the engines update to 0xc we should update LLVM to model loops in the 0xc way, but for now it remains compatible with 0xb and 0xc.
Fix the order of the calls to setTee() when creating tee_locals
Add an explicit drop when creating the _start entry function wrapper if needed
Update dot_s and llvm_autogenerated tests to remove store-results optimization (and few other minor updates)
Fix the test auto-updater to fail if subprocesses fail
There still seems to be a validation failure when building libc (I think it's from the stricter drop rules, but it may be in the source rather than the compiler), but this at least makes Binaryen's tests pa
Diffstat (limited to 'scripts/support.py')
-rwxr-xr-x | scripts/support.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/scripts/support.py b/scripts/support.py index 7b61d5a03..43762fffa 100755 --- a/scripts/support.py +++ b/scripts/support.py @@ -142,10 +142,17 @@ def split_wast(wast): return ret -def run_command(cmd, expected_status=0, stderr=None): +def run_command(cmd, expected_status=0, stderr=None, expected_err=None): + if expected_err is not None: + assert stderr == subprocess.PIPE or stderr is None,\ + "Can't redirect stderr if using expected_err" + stderr = subprocess.PIPE print 'executing: ', ' '.join(cmd) proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=stderr) out, err = proc.communicate() if proc.returncode != expected_status: raise Exception(('run_command failed', err)) + if expected_err is not None and err != expected_err: + raise Exception(('run_command unexpected stderr', + "expected '%s', actual '%s'" % (expected_err, err))) return out |