diff options
author | Heejin Ahn <aheejin@gmail.com> | 2019-11-26 02:36:38 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-26 02:36:38 -0800 |
commit | 6e23f8e5f4d28eb2056d0b3636b8317b9f299bfc (patch) | |
tree | 86072ef1f11098c4c721602c833f4fa4ebcacede /check.py | |
parent | 98ab07f9e471e713e7b00732a84e260aaaecc25f (diff) | |
download | binaryen-6e23f8e5f4d28eb2056d0b3636b8317b9f299bfc.tar.gz binaryen-6e23f8e5f4d28eb2056d0b3636b8317b9f299bfc.tar.bz2 binaryen-6e23f8e5f4d28eb2056d0b3636b8317b9f299bfc.zip |
Print only literal values when printing literals (#2469)
Current `<<` operator on `Literal` prints `[type].const` with it. But
`[type].const` is rather an instruction than a literal itself, and
printing it with the literals makes less sense when we later have
literals whose type don't have `const` instructions (such as reference
types).
This patch
- Makes `<<` operator on `Literal` print only its value
- Makes wasm-shell's shell interface comply with the spec interpreter's
printing format (`value : type`).
- Prints wasm-shell's `[trap]` message to stderr
These make all `fix_` routines for spec tests in check.py unnecessary.
Diffstat (limited to 'check.py')
-rwxr-xr-x | check.py | 18 |
1 files changed, 0 insertions, 18 deletions
@@ -309,24 +309,6 @@ def run_spec_tests(): def check_expected(actual, expected): if expected and os.path.exists(expected): expected = open(expected).read() - - # fix it up, our pretty (i32.const 83) must become compared to a homely 83 : i32 - def fix_expected(x): - x = x.strip() - if not x: - return x - v, t = x.split(' : ') - if v.endswith('.'): - v = v[:-1] # remove trailing '.' - return '(' + t + '.const ' + v + ')' - - def fix_actual(x): - if '[trap ' in x: - return '' - return x - - expected = '\n'.join(map(fix_expected, expected.split('\n'))) - actual = '\n'.join(map(fix_actual, actual.split('\n'))) print(' (using expected output)') actual = actual.strip() expected = expected.strip() |