summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/README.md14
-rw-r--r--test/exceptions/bad-throw.txt2
-rw-r--r--test/exceptions/bad-try.txt2
-rw-r--r--test/exceptions/catch-all-not-last.txt2
-rw-r--r--test/exceptions/rethrow-not-in-catch.txt2
-rw-r--r--test/exceptions/rethrow-to-wrong-block.txt2
-rw-r--r--test/exceptions/try-exports.txt2
-rw-r--r--test/exceptions/try-imports.txt2
-rw-r--r--test/exceptions/try-text.txt2
-rw-r--r--test/exceptions/try.txt2
-rw-r--r--test/find_exe.py12
-rwxr-xr-xtest/gen-spec-js.py52
-rw-r--r--test/help/wast2json.txt26
-rw-r--r--test/help/wat2wasm.txt (renamed from test/help/wast2wasm.txt)23
-rw-r--r--test/parse/assert/assert-after-module.txt2
-rw-r--r--test/parse/assert/assert-return-arithmetic-nan.txt2
-rw-r--r--test/parse/assert/assert-return-canonical-nan.txt2
-rw-r--r--test/parse/assert/assertinvalid-binary-module.txt2
-rw-r--r--test/parse/assert/assertinvalid.txt2
-rw-r--r--test/parse/assert/assertmalformed.txt2
-rw-r--r--test/parse/assert/assertreturn.txt2
-rw-r--r--test/parse/assert/bad-assert-before-module.txt2
-rw-r--r--test/parse/assert/bad-assert-return-arithmetic-nan-invalid-return-type.txt2
-rw-r--r--test/parse/assert/bad-assert-return-arithmetic-nan-too-few.txt2
-rw-r--r--test/parse/assert/bad-assert-return-arithmetic-nan-too-many.txt2
-rw-r--r--test/parse/assert/bad-assert-return-arithmetic-nan-unknown-function.txt2
-rw-r--r--test/parse/assert/bad-assert-return-canonical-nan-invalid-return-type.txt2
-rw-r--r--test/parse/assert/bad-assert-return-canonical-nan-too-few.txt2
-rw-r--r--test/parse/assert/bad-assert-return-canonical-nan-too-many.txt2
-rw-r--r--test/parse/assert/bad-assert-return-canonical-nan-unknown-function.txt2
-rw-r--r--test/parse/assert/bad-assertreturn-non-const.txt2
-rw-r--r--test/parse/assert/bad-assertreturn-too-few.txt2
-rw-r--r--test/parse/assert/bad-assertreturn-too-many.txt2
-rw-r--r--test/parse/assert/bad-assertreturn-unknown-function.txt2
-rw-r--r--test/parse/assert/bad-invoke-no-module.txt2
-rw-r--r--test/parse/assert/bad-invoke-too-few.txt2
-rw-r--r--test/parse/assert/bad-invoke-too-many.txt2
-rw-r--r--test/parse/assert/bad-invoke-unknown-function.txt2
-rw-r--r--test/parse/assert/invoke.txt2
-rw-r--r--test/parse/force-color.txt2
-rwxr-xr-xtest/run-gen-spec-js.py10
-rwxr-xr-xtest/run-interp.py20
-rwxr-xr-xtest/run-objdump.py22
-rw-r--r--test/run-opcodecnt.py10
-rwxr-xr-xtest/run-roundtrip.py22
-rwxr-xr-xtest/run-tests.py14
-rwxr-xr-xtest/run-wasm-link.py10
-rw-r--r--test/too-many-arguments.txt2
-rw-r--r--test/typecheck/bad-assertreturn-invoke-type-mismatch.txt2
-rw-r--r--test/typecheck/bad-assertreturn-type-mismatch.txt2
-rw-r--r--test/typecheck/bad-invoke-type-mismatch.txt2
51 files changed, 176 insertions, 137 deletions
diff --git a/test/README.md b/test/README.md
index 207ab633..297c356d 100644
--- a/test/README.md
+++ b/test/README.md
@@ -95,12 +95,12 @@ expected stderr
```
The test runner will copy the input to a temporary file and pass it as an
-argument to the executable (which by default is `out/wast2wasm`).
+argument to the executable (which by default is `out/wat2wasm`).
The currently supported list of keys:
- `TOOL`: a set of preconfigured keys, see below.
-- `EXE`: the executable to run, defaults to out/wast2wasm
+- `EXE`: the executable to run, defaults to out/wat2wasm
- `STDIN_FILE`: the file to use for STDIN instead of the contents of this file.
- `FLAGS`: additional flags to pass to the executable
- `ENV`: environment variables to set, separated by spaces
@@ -112,7 +112,7 @@ The currently supported list of keys:
The currently supported list of tools (see
[run-tests.py](https://github.com/WebAssembly/wabt/blob/master/test/run-tests.py#L44)):
-- `wast2wasm`: parse a wasm text file and validate it.
+- `wat2wasm`: parse a wasm text file and validate it.
- `wast-desugar`: parse the wasm text file and rewrite it in the canonical text
format.
- `run-objdump`: parse a wasm text file, convert it to binary, then run
@@ -150,11 +150,11 @@ There's otherwise no logic attached to a test being in a given directory.
Here is a brief description of the tests are contained in each top-level
subdirectory:
-- `binary`: Tests binary files that are impossible to generate via wast2wasm.
+- `binary`: Tests binary files that are impossible to generate via wat2wasm.
Typically these are illegal binary files, to ensure binary file reading is
robust.
- `desugar`: Tests the `wast-desugar` tool.
-- `dump`: Tests the verbose output of `wast2wasm` and the output of
+- `dump`: Tests the verbose output of `wat2wasm` and the output of
`wasm-objdump`.
- `exceptions`: Tests the new experimental exceptions feature.
- `gen-spec-js`: Tests the gen-spec-js tool, which converts a spec test into a
@@ -163,7 +163,7 @@ subdirectory:
- `interp`: Tests the `wasm-interp` tool.
- `link`: Tests the `wasm-link` tool.
- `opcodecnt`: Tests the `wasm-opcodecnt` tool.
-- `parse`: Tests parsing via the `wast2wasm` tool.
+- `parse`: Tests parsing via the `wat2wasm` tool.
- `regress`: Various regression tests that are irregular and don't fit
naturally in the other directories.
- `roundtrip`: Tests that roundtripping the text to binary and back to text
@@ -172,7 +172,7 @@ subdirectory:
`gen-wasm.py` and should be placed in the `binary` directory instead).
- `spec`: All of the spec core tests. These tests are auto-generated by the
`update-spec-tests.py` script.
-- `typecheck`: Tests the wast validation in the `wast2wasm` tool.
+- `typecheck`: Tests the wast validation in the `wat2wasm` tool.
## Writing New Tests
diff --git a/test/exceptions/bad-throw.txt b/test/exceptions/bad-throw.txt
index 5558c8a7..b02b3e6e 100644
--- a/test/exceptions/bad-throw.txt
+++ b/test/exceptions/bad-throw.txt
@@ -1,4 +1,4 @@
-;;; TOOL: wast2wasm
+;;; TOOL: wat2wasm
;;; FLAGS: --enable-exceptions -v
;;; ERROR: 1
(module
diff --git a/test/exceptions/bad-try.txt b/test/exceptions/bad-try.txt
index 2321da47..808235fd 100644
--- a/test/exceptions/bad-try.txt
+++ b/test/exceptions/bad-try.txt
@@ -1,4 +1,4 @@
-;;; TOOL: wast2wasm
+;;; TOOL: wat2wasm
;;; ERROR: 1
(module
(func (result i32)
diff --git a/test/exceptions/catch-all-not-last.txt b/test/exceptions/catch-all-not-last.txt
index 67cbcdc6..6833c807 100644
--- a/test/exceptions/catch-all-not-last.txt
+++ b/test/exceptions/catch-all-not-last.txt
@@ -1,4 +1,4 @@
-;;; TOOL: wast2wasm
+;;; TOOL: wat2wasm
;;; FLAGS: --enable-exceptions -v
;;; ERROR: 1
(module
diff --git a/test/exceptions/rethrow-not-in-catch.txt b/test/exceptions/rethrow-not-in-catch.txt
index cfa9a3a2..2f9c4cb3 100644
--- a/test/exceptions/rethrow-not-in-catch.txt
+++ b/test/exceptions/rethrow-not-in-catch.txt
@@ -1,4 +1,4 @@
-;;; TOOL: wast2wasm
+;;; TOOL: wat2wasm
;;; FLAGS: --enable-exceptions -v
;;; ERROR: 1
(module
diff --git a/test/exceptions/rethrow-to-wrong-block.txt b/test/exceptions/rethrow-to-wrong-block.txt
index 8bd08e60..9a932706 100644
--- a/test/exceptions/rethrow-to-wrong-block.txt
+++ b/test/exceptions/rethrow-to-wrong-block.txt
@@ -1,4 +1,4 @@
-;;; TOOL: wast2wasm
+;;; TOOL: wat2wasm
;;; FLAGS: --enable-exceptions -v
;;; ERROR: 1
(module
diff --git a/test/exceptions/try-exports.txt b/test/exceptions/try-exports.txt
index b1310ba2..500c87c8 100644
--- a/test/exceptions/try-exports.txt
+++ b/test/exceptions/try-exports.txt
@@ -1,4 +1,4 @@
-;;; TOOL: wast2wasm
+;;; TOOL: wat2wasm
;;; FLAGS: --enable-exceptions -v
(module
(except $ex i32)
diff --git a/test/exceptions/try-imports.txt b/test/exceptions/try-imports.txt
index 85f854e8..51b09947 100644
--- a/test/exceptions/try-imports.txt
+++ b/test/exceptions/try-imports.txt
@@ -1,4 +1,4 @@
-;;; TOOL: wast2wasm
+;;; TOOL: wat2wasm
;;; FLAGS: --enable-exceptions -v
(module
(import "c++" "except" (except $ex i32))
diff --git a/test/exceptions/try-text.txt b/test/exceptions/try-text.txt
index 3f2d5adb..4247b744 100644
--- a/test/exceptions/try-text.txt
+++ b/test/exceptions/try-text.txt
@@ -1,4 +1,4 @@
-;;; TOOL: wast2wasm
+;;; TOOL: wat2wasm
;;; FLAGS: --enable-exceptions -v
(module
(except $ex i32)
diff --git a/test/exceptions/try.txt b/test/exceptions/try.txt
index a18a977b..879aff7c 100644
--- a/test/exceptions/try.txt
+++ b/test/exceptions/try.txt
@@ -1,4 +1,4 @@
-;;; TOOL: wast2wasm
+;;; TOOL: wat2wasm
;;; FLAGS: --enable-exceptions -v
(module
(except $ex i32)
diff --git a/test/find_exe.py b/test/find_exe.py
index d05fac18..a7046605 100644
--- a/test/find_exe.py
+++ b/test/find_exe.py
@@ -24,8 +24,8 @@ IS_WINDOWS = sys.platform == 'win32'
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
REPO_ROOT_DIR = os.path.dirname(SCRIPT_DIR)
EXECUTABLES = [
- 'wast2wasm', 'wasm2wat', 'wasm-objdump', 'wasm-interp', 'wasm-opcodecnt',
- 'wast-desugar', 'wasm-link'
+ 'wat2wasm', 'wast2json', 'wasm2wat', 'wasm-objdump', 'wasm-interp',
+ 'wasm-opcodecnt', 'wast-desugar', 'wasm-link'
]
@@ -64,8 +64,12 @@ def FindExecutable(basename, override=None):
return FindExeWithFallback(basename, [GetDefaultExe(basename)], override)
-def GetWast2WasmExecutable(override=None):
- return FindExecutable('wast2wasm', override)
+def GetWat2WasmExecutable(override=None):
+ return FindExecutable('wat2wasm', override)
+
+
+def GetWast2JsonExecutable(override=None):
+ return FindExecutable('wast2json', override)
def GetWasm2WatExecutable(override=None):
diff --git a/test/gen-spec-js.py b/test/gen-spec-js.py
index 40d22020..5e8d65ca 100755
--- a/test/gen-spec-js.py
+++ b/test/gen-spec-js.py
@@ -134,7 +134,7 @@ def F64ToJS(f64_bits):
def UnescapeWasmString(s):
- # Wast allows for more escape characters than this, but we assume that
+ # Wat allows for more escape characters than this, but we assume that
# wasm2wat will only use the \xx escapes.
result = ''
i = 0
@@ -218,29 +218,29 @@ def CollectInvalidModuleCommands(commands):
class ModuleExtender(object):
- def __init__(self, wast2wasm, wasm2wat, temp_dir):
- self.wast2wasm = wast2wasm
+ def __init__(self, wat2wasm, wasm2wat, temp_dir):
+ self.wat2wasm = wat2wasm
self.wasm2wat = wasm2wat
self.temp_dir = temp_dir
self.lines = []
self.exports = {}
def Extend(self, wasm_path, commands):
- wast_path = self._RunWasm2Wat(wasm_path)
- with open(wast_path) as wast_file:
- wast = wast_file.read()
+ wat_path = self._RunWasm2Wat(wasm_path)
+ with open(wat_path) as wat_file:
+ wat = wat_file.read()
self.lines = []
- self.exports = self._GetExports(wast)
+ self.exports = self._GetExports(wat)
for i, command in enumerate(commands):
self._Command(i, command)
- wast = wast[:wast.rindex(')')] + '\n\n'
- wast += '\n'.join(self.lines) + ')'
- # print wast
- with open(wast_path, 'w') as wast_file:
- wast_file.write(wast)
- return self._RunWast2Wasm(wast_path)
+ wat = wat[:wat.rindex(')')] + '\n\n'
+ wat += '\n'.join(self.lines) + ')'
+ # print wat
+ with open(wat_path, 'w') as wat_file:
+ wat_file.write(wat)
+ return self._RunWat2Wasm(wat_path)
def _Command(self, index, command):
command_type = command['type']
@@ -288,10 +288,10 @@ class ModuleExtender(object):
# Change the command to assert_return, it won't return NaN anymore.
command['type'] = 'assert_return'
- def _GetExports(self, wast):
+ def _GetExports(self, wat):
result = {}
pattern = r'^\s*\(export \"(.*?)\"\s*\((\w+) (\d+)'
- for name, type_, index in re.findall(pattern, wast, re.MULTILINE):
+ for name, type_, index in re.findall(pattern, wat, re.MULTILINE):
result[UnescapeWasmString(name)] = (type_, index)
return result
@@ -366,13 +366,13 @@ class ModuleExtender(object):
self.lines.append(inst)
def _RunWasm2Wat(self, wasm_path):
- wast_path = ChangeDir(ChangeExt(wasm_path, '.wast'), self.temp_dir)
- self.wasm2wat.RunWithArgs(wasm_path, '-o', wast_path)
- return wast_path
+ wat_path = ChangeDir(ChangeExt(wasm_path, '.wat'), self.temp_dir)
+ self.wasm2wat.RunWithArgs(wasm_path, '-o', wat_path)
+ return wat_path
- def _RunWast2Wasm(self, wast_path):
- wasm_path = ChangeDir(ChangeExt(wast_path, '.wasm'), self.temp_dir)
- self.wast2wasm.RunWithArgs(wast_path, '-o', wasm_path)
+ def _RunWat2Wasm(self, wat_path):
+ wasm_path = ChangeDir(ChangeExt(wat_path, '.wasm'), self.temp_dir)
+ self.wat2wasm.RunWithArgs(wat_path, '-o', wasm_path)
return wasm_path
@@ -484,7 +484,7 @@ def main(args):
default=find_exe.GetDefaultPath(),
help='directory to search for all executables.')
parser.add_argument('--temp-dir', metavar='PATH',
- help='set the directory that temporary wasm/wast'
+ help='set the directory that temporary wasm/wat'
' files are written.')
parser.add_argument('--no-error-cmdline',
help='don\'t display the subprocess\'s commandline when'
@@ -496,14 +496,14 @@ def main(args):
parser.add_argument('file', help='spec json file.')
options = parser.parse_args(args)
- wast2wasm = Executable(
- find_exe.GetWast2WasmExecutable(options.bindir),
+ wat2wasm = Executable(
+ find_exe.GetWat2WasmExecutable(options.bindir),
error_cmdline=options.error_cmdline)
wasm2wat = Executable(
find_exe.GetWasm2WatExecutable(options.bindir),
error_cmdline=options.error_cmdline)
- wast2wasm.verbose = options.print_cmd
+ wat2wasm.verbose = options.print_cmd
wasm2wat.verbose = options.print_cmd
with open(options.file) as json_file:
@@ -515,7 +515,7 @@ def main(args):
modules = CollectInvalidModuleCommands(all_commands)
with utils.TempDirectory(options.temp_dir, 'gen-spec-js-') as temp_dir:
- extender = ModuleExtender(wast2wasm, wasm2wat, temp_dir)
+ extender = ModuleExtender(wat2wasm, wasm2wat, temp_dir)
for module_command, assert_commands in modules:
if assert_commands:
wasm_path = os.path.join(json_dir, module_command['filename'])
diff --git a/test/help/wast2json.txt b/test/help/wast2json.txt
new file mode 100644
index 00000000..ebf9564b
--- /dev/null
+++ b/test/help/wast2json.txt
@@ -0,0 +1,26 @@
+;;; EXE: %(wast2json)s
+;;; FLAGS: --help
+(;; STDOUT ;;;
+usage: wast2json [options] filename
+
+ read a file in the wasm spec test format, check it for errors, and
+ convert it to a JSON file and associated wasm binary files.
+
+examples:
+ # parse spec-test.wast, and write files to spec-test.json. Modules are
+ # written to spec-test.0.wasm, spec-test.1.wasm, etc.
+ $ wast2json spec-test.wast -o spec-test.json
+
+options:
+ -v, --verbose Use multiple times for more info
+ -h, --help Print this help message
+ --debug-parser Turn on debugging the parser of wast files
+ --enable-exceptions Experimental exception handling
+ --enable-saturating-float-to-int Saturating float-to-int operators
+ --enable-threads Threading support
+ -o, --output=FILE output wasm binary file
+ -r, --relocatable Create a relocatable wasm binary (suitable for linking with wasm-link)
+ --no-canonicalize-leb128s Write all LEB128 sizes as 5-bytes instead of their minimal size
+ --debug-names Write debug names to the generated binary file
+ --no-check Don't check for invalid modules
+;;; STDOUT ;;)
diff --git a/test/help/wast2wasm.txt b/test/help/wat2wasm.txt
index 0e4cdfa0..16ed27ea 100644
--- a/test/help/wast2wasm.txt
+++ b/test/help/wat2wasm.txt
@@ -1,37 +1,32 @@
-;;; EXE: %(wast2wasm)s
+;;; EXE: %(wat2wasm)s
;;; FLAGS: --help
(;; STDOUT ;;;
-usage: wast2wasm [options] filename
+usage: wat2wasm [options] filename
- read a file in the wasm s-expression format, check it for errors, and
+ read a file in the wasm text format, check it for errors, and
convert it to the wasm binary format.
examples:
- # parse and typecheck test.wast
- $ wast2wasm test.wast
+ # parse and typecheck test.wat
+ $ wat2wasm test.wat
- # parse test.wast and write to binary file test.wasm
- $ wast2wasm test.wast -o test.wasm
+ # parse test.wat and write to binary file test.wasm
+ $ wat2wasm test.wat -o test.wasm
# parse spec-test.wast, and write verbose output to stdout (including
# the meaning of every byte)
- $ wast2wasm spec-test.wast -v
-
- # parse spec-test.wast, and write files to spec-test.json. Modules are
- # written to spec-test.0.wasm, spec-test.1.wasm, etc.
- $ wast2wasm spec-test.wast --spec -o spec-test.json
+ $ wat2wasm spec-test.wast -v
options:
-v, --verbose Use multiple times for more info
-h, --help Print this help message
- --debug-parser Turn on debugging the parser of wast files
+ --debug-parser Turn on debugging the parser of wat files
-d, --dump-module Print a hexdump of the module to stdout
--enable-exceptions Experimental exception handling
--enable-saturating-float-to-int Saturating float-to-int operators
--enable-threads Threading support
-o, --output=FILE output wasm binary file
-r, --relocatable Create a relocatable wasm binary (suitable for linking with wasm-link)
- --spec Parse a file with multiple modules and assertions, like the spec tests
--no-canonicalize-leb128s Write all LEB128 sizes as 5-bytes instead of their minimal size
--debug-names Write debug names to the generated binary file
--no-check Don't check for invalid modules
diff --git a/test/parse/assert/assert-after-module.txt b/test/parse/assert/assert-after-module.txt
index caa09bc3..6887e79e 100644
--- a/test/parse/assert/assert-after-module.txt
+++ b/test/parse/assert/assert-after-module.txt
@@ -1,4 +1,4 @@
-;;; FLAGS: --spec
+;;; TOOL: wast2json
(module
(export "f" (func 0))
(func (result i32)
diff --git a/test/parse/assert/assert-return-arithmetic-nan.txt b/test/parse/assert/assert-return-arithmetic-nan.txt
index 0d135b1c..ac185883 100644
--- a/test/parse/assert/assert-return-arithmetic-nan.txt
+++ b/test/parse/assert/assert-return-arithmetic-nan.txt
@@ -1,4 +1,4 @@
-;;; FLAGS: --spec
+;;; TOOL: wast2json
(module
(func $foo (param f32) (result f32)
get_local 0
diff --git a/test/parse/assert/assert-return-canonical-nan.txt b/test/parse/assert/assert-return-canonical-nan.txt
index d586833e..fc973f9c 100644
--- a/test/parse/assert/assert-return-canonical-nan.txt
+++ b/test/parse/assert/assert-return-canonical-nan.txt
@@ -1,4 +1,4 @@
-;;; FLAGS: --spec
+;;; TOOL: wast2json
(module
(func $foo (param f32) (result f32)
get_local 0
diff --git a/test/parse/assert/assertinvalid-binary-module.txt b/test/parse/assert/assertinvalid-binary-module.txt
index 47338550..58ce33ab 100644
--- a/test/parse/assert/assertinvalid-binary-module.txt
+++ b/test/parse/assert/assertinvalid-binary-module.txt
@@ -1,3 +1,3 @@
-;;; FLAGS: --spec
+;;; TOOL: wast2json
(assert_invalid (module binary "\00ASM") "bad magic")
(module)
diff --git a/test/parse/assert/assertinvalid.txt b/test/parse/assert/assertinvalid.txt
index 511a7f7f..85090839 100644
--- a/test/parse/assert/assertinvalid.txt
+++ b/test/parse/assert/assertinvalid.txt
@@ -1,4 +1,4 @@
-;;; FLAGS: --spec
+;;; TOOL: wast2json
(assert_invalid
(module
(func
diff --git a/test/parse/assert/assertmalformed.txt b/test/parse/assert/assertmalformed.txt
index 30559e01..34827fa9 100644
--- a/test/parse/assert/assertmalformed.txt
+++ b/test/parse/assert/assertmalformed.txt
@@ -1,4 +1,4 @@
-;;; FLAGS: --spec
+;;; TOOL: wast2json
(assert_malformed
(module binary
"\00asm\bc\0a\00\00")
diff --git a/test/parse/assert/assertreturn.txt b/test/parse/assert/assertreturn.txt
index 301dcf78..8339d773 100644
--- a/test/parse/assert/assertreturn.txt
+++ b/test/parse/assert/assertreturn.txt
@@ -1,4 +1,4 @@
-;;; FLAGS: --spec
+;;; TOOL: wast2json
(module
(func $foo (result i32) i32.const 0)
(export "foo" (func $foo))
diff --git a/test/parse/assert/bad-assert-before-module.txt b/test/parse/assert/bad-assert-before-module.txt
index 031b6203..6bade1bd 100644
--- a/test/parse/assert/bad-assert-before-module.txt
+++ b/test/parse/assert/bad-assert-before-module.txt
@@ -1,4 +1,4 @@
-;;; FLAGS: --spec
+;;; TOOL: wast2json
;;; ERROR: 1
(assert_return (invoke "f") (i32.const 0))
(;; STDERR ;;;
diff --git a/test/parse/assert/bad-assert-return-arithmetic-nan-invalid-return-type.txt b/test/parse/assert/bad-assert-return-arithmetic-nan-invalid-return-type.txt
index 08bf4bc8..97b8ffae 100644
--- a/test/parse/assert/bad-assert-return-arithmetic-nan-invalid-return-type.txt
+++ b/test/parse/assert/bad-assert-return-arithmetic-nan-invalid-return-type.txt
@@ -1,5 +1,5 @@
+;;; TOOL: wast2json
;;; ERROR: 1
-;;; FLAGS: --spec
(module
(func $foo (result i32)
i32.const 0)
diff --git a/test/parse/assert/bad-assert-return-arithmetic-nan-too-few.txt b/test/parse/assert/bad-assert-return-arithmetic-nan-too-few.txt
index fe1a5ca6..498fe9e0 100644
--- a/test/parse/assert/bad-assert-return-arithmetic-nan-too-few.txt
+++ b/test/parse/assert/bad-assert-return-arithmetic-nan-too-few.txt
@@ -1,5 +1,5 @@
+;;; TOOL: wast2json
;;; ERROR: 1
-;;; FLAGS: --spec
(module
(func $foo (param i32) (result f32)
f32.const 0)
diff --git a/test/parse/assert/bad-assert-return-arithmetic-nan-too-many.txt b/test/parse/assert/bad-assert-return-arithmetic-nan-too-many.txt
index 0a73e02a..c2e258f4 100644
--- a/test/parse/assert/bad-assert-return-arithmetic-nan-too-many.txt
+++ b/test/parse/assert/bad-assert-return-arithmetic-nan-too-many.txt
@@ -1,5 +1,5 @@
+;;; TOOL: wast2json
;;; ERROR: 1
-;;; FLAGS: --spec
(module
(func $foo (result f32)
f32.const 0)
diff --git a/test/parse/assert/bad-assert-return-arithmetic-nan-unknown-function.txt b/test/parse/assert/bad-assert-return-arithmetic-nan-unknown-function.txt
index aba879ca..24e371f3 100644
--- a/test/parse/assert/bad-assert-return-arithmetic-nan-unknown-function.txt
+++ b/test/parse/assert/bad-assert-return-arithmetic-nan-unknown-function.txt
@@ -1,5 +1,5 @@
+;;; TOOL: wast2json
;;; ERROR: 1
-;;; FLAGS: --spec
(module)
(assert_return_arithmetic_nan (invoke "foo"))
(;; STDERR ;;;
diff --git a/test/parse/assert/bad-assert-return-canonical-nan-invalid-return-type.txt b/test/parse/assert/bad-assert-return-canonical-nan-invalid-return-type.txt
index ae57b5b1..005c4ff6 100644
--- a/test/parse/assert/bad-assert-return-canonical-nan-invalid-return-type.txt
+++ b/test/parse/assert/bad-assert-return-canonical-nan-invalid-return-type.txt
@@ -1,5 +1,5 @@
+;;; TOOL: wast2json
;;; ERROR: 1
-;;; FLAGS: --spec
(module
(func $foo (result i32)
i32.const 0)
diff --git a/test/parse/assert/bad-assert-return-canonical-nan-too-few.txt b/test/parse/assert/bad-assert-return-canonical-nan-too-few.txt
index 8520a26a..73c40241 100644
--- a/test/parse/assert/bad-assert-return-canonical-nan-too-few.txt
+++ b/test/parse/assert/bad-assert-return-canonical-nan-too-few.txt
@@ -1,5 +1,5 @@
+;;; TOOL: wast2json
;;; ERROR: 1
-;;; FLAGS: --spec
(module
(func $foo (param i32) (result f32)
f32.const 0)
diff --git a/test/parse/assert/bad-assert-return-canonical-nan-too-many.txt b/test/parse/assert/bad-assert-return-canonical-nan-too-many.txt
index 8fef859b..acae9b3f 100644
--- a/test/parse/assert/bad-assert-return-canonical-nan-too-many.txt
+++ b/test/parse/assert/bad-assert-return-canonical-nan-too-many.txt
@@ -1,5 +1,5 @@
+;;; TOOL: wast2json
;;; ERROR: 1
-;;; FLAGS: --spec
(module
(func $foo (result f32)
f32.const 0)
diff --git a/test/parse/assert/bad-assert-return-canonical-nan-unknown-function.txt b/test/parse/assert/bad-assert-return-canonical-nan-unknown-function.txt
index 7f69f31e..0d614bc1 100644
--- a/test/parse/assert/bad-assert-return-canonical-nan-unknown-function.txt
+++ b/test/parse/assert/bad-assert-return-canonical-nan-unknown-function.txt
@@ -1,5 +1,5 @@
+;;; TOOL: wast2json
;;; ERROR: 1
-;;; FLAGS: --spec
(module)
(assert_return_canonical_nan (invoke "foo"))
(;; STDERR ;;;
diff --git a/test/parse/assert/bad-assertreturn-non-const.txt b/test/parse/assert/bad-assertreturn-non-const.txt
index a05ef85a..ee805c75 100644
--- a/test/parse/assert/bad-assertreturn-non-const.txt
+++ b/test/parse/assert/bad-assertreturn-non-const.txt
@@ -1,5 +1,5 @@
+;;; TOOL: wast2json
;;; ERROR: 1
-;;; FLAGS: --spec
(module
(func $bar (param f32) (result f32)
get_local 0)
diff --git a/test/parse/assert/bad-assertreturn-too-few.txt b/test/parse/assert/bad-assertreturn-too-few.txt
index 5c73c2ee..e969883c 100644
--- a/test/parse/assert/bad-assertreturn-too-few.txt
+++ b/test/parse/assert/bad-assertreturn-too-few.txt
@@ -1,5 +1,5 @@
+;;; TOOL: wast2json
;;; ERROR: 1
-;;; FLAGS: --spec
(module
(func $foo (param i32) (result i32)
get_local 0)
diff --git a/test/parse/assert/bad-assertreturn-too-many.txt b/test/parse/assert/bad-assertreturn-too-many.txt
index 3ea0637e..ed72a44e 100644
--- a/test/parse/assert/bad-assertreturn-too-many.txt
+++ b/test/parse/assert/bad-assertreturn-too-many.txt
@@ -1,5 +1,5 @@
+;;; TOOL: wast2json
;;; ERROR: 1
-;;; FLAGS: --spec
(module
(func $foo (result i32)
i32.const 0)
diff --git a/test/parse/assert/bad-assertreturn-unknown-function.txt b/test/parse/assert/bad-assertreturn-unknown-function.txt
index c4f981f7..929e5b75 100644
--- a/test/parse/assert/bad-assertreturn-unknown-function.txt
+++ b/test/parse/assert/bad-assertreturn-unknown-function.txt
@@ -1,5 +1,5 @@
+;;; TOOL: wast2json
;;; ERROR: 1
-;;; FLAGS: --spec
(module)
(assert_return (invoke "foo") (i32.const 0))
(;; STDERR ;;;
diff --git a/test/parse/assert/bad-invoke-no-module.txt b/test/parse/assert/bad-invoke-no-module.txt
index a761c5a2..801a2a98 100644
--- a/test/parse/assert/bad-invoke-no-module.txt
+++ b/test/parse/assert/bad-invoke-no-module.txt
@@ -1,5 +1,5 @@
+;;; TOOL: wast2json
;;; ERROR: 1
-;;; FLAGS: --spec
(invoke "foo")
(;; STDERR ;;;
out/test/parse/assert/bad-invoke-no-module.txt:3:2: error: unknown module
diff --git a/test/parse/assert/bad-invoke-too-few.txt b/test/parse/assert/bad-invoke-too-few.txt
index 4554cb8f..c1e34e11 100644
--- a/test/parse/assert/bad-invoke-too-few.txt
+++ b/test/parse/assert/bad-invoke-too-few.txt
@@ -1,5 +1,5 @@
+;;; TOOL: wast2json
;;; ERROR: 1
-;;; FLAGS: --spec
(module
(func (param i32))
(export "foo" (func 0)))
diff --git a/test/parse/assert/bad-invoke-too-many.txt b/test/parse/assert/bad-invoke-too-many.txt
index cd2df9bd..e55eb4f0 100644
--- a/test/parse/assert/bad-invoke-too-many.txt
+++ b/test/parse/assert/bad-invoke-too-many.txt
@@ -1,5 +1,5 @@
+;;; TOOL: wast2json
;;; ERROR: 1
-;;; FLAGS: --spec
(module
(func (param i32))
(export "foo" (func 0)))
diff --git a/test/parse/assert/bad-invoke-unknown-function.txt b/test/parse/assert/bad-invoke-unknown-function.txt
index 26f0c0ff..f5db4509 100644
--- a/test/parse/assert/bad-invoke-unknown-function.txt
+++ b/test/parse/assert/bad-invoke-unknown-function.txt
@@ -1,5 +1,5 @@
+;;; TOOL: wast2json
;;; ERROR: 1
-;;; FLAGS: --spec
(module
(export "foo" (func $foo))
(func $foo))
diff --git a/test/parse/assert/invoke.txt b/test/parse/assert/invoke.txt
index 393c000e..fba32549 100644
--- a/test/parse/assert/invoke.txt
+++ b/test/parse/assert/invoke.txt
@@ -1,4 +1,4 @@
-;;; FLAGS: --spec
+;;; TOOL: wast2json
(module
(export "test" (func $test))
(func $test (param i32) (result i32)
diff --git a/test/parse/force-color.txt b/test/parse/force-color.txt
index a898631d..304b8b8d 100644
--- a/test/parse/force-color.txt
+++ b/test/parse/force-color.txt
@@ -1,5 +1,5 @@
;;; ERROR: 1
-;;; TOOL: wast2wasm
+;;; TOOL: wat2wasm
;;; ENV: FORCE_COLOR=1
(module
(func badname (param i32) (result badtype)
diff --git a/test/run-gen-spec-js.py b/test/run-gen-spec-js.py
index 5afc5f9e..a80a2464 100755
--- a/test/run-gen-spec-js.py
+++ b/test/run-gen-spec-js.py
@@ -54,14 +54,14 @@ def main(args):
parser.add_argument('-p', '--print-cmd',
help='print the commands that are run.',
action='store_true')
- parser.add_argument('file', help='wast file.')
+ parser.add_argument('file', help='wat file.')
options = parser.parse_args(args)
with utils.TempDirectory(options.out_dir, 'run-gen-spec-js-') as out_dir:
- wast2wasm = utils.Executable(
- find_exe.GetWast2WasmExecutable(options.bindir), '--spec',
+ wast2json = utils.Executable(
+ find_exe.GetWast2JsonExecutable(options.bindir),
error_cmdline=options.error_cmdline)
- wast2wasm.AppendOptionalArgs({'-v': options.verbose})
+ wast2json.AppendOptionalArgs({'-v': options.verbose})
gen_spec_js = utils.Executable(sys.executable, GEN_SPEC_JS_PY,
'--temp-dir', out_dir,
@@ -75,7 +75,7 @@ def main(args):
json_file = utils.ChangeDir(
utils.ChangeExt(options.file, '.json'), out_dir)
js_file = utils.ChangeExt(json_file, '.js')
- wast2wasm.RunWithArgs(options.file, '-o', json_file)
+ wast2json.RunWithArgs(options.file, '-o', json_file)
if options.js_engine:
gen_spec_js.RunWithArgs(json_file, '-o', js_file)
diff --git a/test/run-interp.py b/test/run-interp.py
index 27aa081b..664a6d87 100755
--- a/test/run-interp.py
+++ b/test/run-interp.py
@@ -51,12 +51,18 @@ def main(args):
parser.add_argument('--enable-threads', action='store_true')
options = parser.parse_args(args)
- wast2wasm = utils.Executable(
- find_exe.GetWast2WasmExecutable(options.bindir),
- error_cmdline=options.error_cmdline)
- wast2wasm.AppendOptionalArgs({
+ wast_tool = None
+ if options.spec:
+ wast_tool = utils.Executable(
+ find_exe.GetWast2JsonExecutable(options.bindir),
+ error_cmdline=options.error_cmdline)
+ else:
+ wast_tool = utils.Executable(
+ find_exe.GetWat2WasmExecutable(options.bindir),
+ error_cmdline=options.error_cmdline)
+
+ wast_tool.AppendOptionalArgs({
'-v': options.verbose,
- '--spec': options.spec,
'--enable-saturating-float-to-int':
options.enable_saturating_float_to_int,
'--enable-threads': options.enable_threads,
@@ -75,13 +81,13 @@ def main(args):
'--enable-threads': options.enable_threads,
})
- wast2wasm.verbose = options.print_cmd
+ wast_tool.verbose = options.print_cmd
wasm_interp.verbose = options.print_cmd
with utils.TempDirectory(options.out_dir, 'run-interp-') as out_dir:
new_ext = '.json' if options.spec else '.wasm'
out_file = utils.ChangeDir(utils.ChangeExt(options.file, new_ext), out_dir)
- wast2wasm.RunWithArgs(options.file, '-o', out_file)
+ wast_tool.RunWithArgs(options.file, '-o', out_file)
wasm_interp.RunWithArgs(out_file)
return 0
diff --git a/test/run-objdump.py b/test/run-objdump.py
index 56411876..e86a1b22 100755
--- a/test/run-objdump.py
+++ b/test/run-objdump.py
@@ -44,7 +44,6 @@ def main(args):
action='store_true')
parser.add_argument('--headers', action='store_true')
parser.add_argument('--no-check', action='store_true')
- parser.add_argument('-c', '--compile-only', action='store_true')
parser.add_argument('--dump-verbose', action='store_true')
parser.add_argument('--dump-debug', action='store_true')
parser.add_argument('--enable-exceptions', action='store_true')
@@ -65,10 +64,17 @@ def main(args):
gen_wasm = utils.Executable(sys.executable, GEN_WASM_PY,
error_cmdline=options.error_cmdline)
- wast2wasm = utils.Executable(
- find_exe.GetWast2WasmExecutable(options.bindir),
- error_cmdline=options.error_cmdline)
- wast2wasm.AppendOptionalArgs({
+ wat_tool = None
+ if options.spec:
+ wat_tool = utils.Executable(
+ find_exe.GetWast2JsonExecutable(options.bindir),
+ error_cmdline=options.error_cmdline)
+ else:
+ wat_tool = utils.Executable(
+ find_exe.GetWat2WasmExecutable(options.bindir),
+ error_cmdline=options.error_cmdline)
+
+ wat_tool.AppendOptionalArgs({
'--debug-names': options.debug_names,
'--enable-exceptions': options.enable_exceptions,
'--enable-saturating-float-to-int':
@@ -76,10 +82,8 @@ def main(args):
'--enable-threads': options.enable_threads,
'--no-check': options.no_check,
'--no-canonicalize-leb128s': options.no_canonicalize_leb128s,
- '--spec': options.spec,
'-v': options.verbose,
'-r': options.relocatable,
- '-c': options.compile_only,
})
wasm_objdump = utils.Executable(
@@ -96,7 +100,7 @@ def main(args):
})
gen_wasm.verbose = options.print_cmd
- wast2wasm.verbose = options.print_cmd
+ wat_tool.verbose = options.print_cmd
wasm_objdump.verbose = options.print_cmd
filename = options.file
@@ -112,7 +116,7 @@ def main(args):
out_file = os.path.join(out_dir, basename_noext + '.json')
else:
out_file = os.path.join(out_dir, basename_noext + '.wasm')
- wast2wasm.RunWithArgs('-o', out_file, filename)
+ wat_tool.RunWithArgs('-o', out_file, filename)
if options.spec:
wasm_files = utils.GetModuleFilenamesFromSpecJSON(out_file)
diff --git a/test/run-opcodecnt.py b/test/run-opcodecnt.py
index 741a0e6b..4b508bdd 100644
--- a/test/run-opcodecnt.py
+++ b/test/run-opcodecnt.py
@@ -46,10 +46,10 @@ def main(args):
parser.add_argument('file', help='test file.')
options = parser.parse_args(args)
- wast2wasm = utils.Executable(
- find_exe.GetWast2WasmExecutable(options.bindir),
+ wat2wasm = utils.Executable(
+ find_exe.GetWat2WasmExecutable(options.bindir),
error_cmdline=options.error_cmdline)
- wast2wasm.AppendOptionalArgs({
+ wat2wasm.AppendOptionalArgs({
'-v': options.verbose,
})
@@ -57,12 +57,12 @@ def main(args):
find_exe.GetWasmOpcodeCntExecutable(options.bindir),
error_cmdline=options.error_cmdline)
- wast2wasm.verbose = options.print_cmd
+ wat2wasm.verbose = options.print_cmd
wasm_opcodecnt.verbose = options.print_cmd
with utils.TempDirectory(options.out_dir, 'run-opcodecnt-') as out_dir:
out_file = utils.ChangeDir(utils.ChangeExt(options.file, '.wasm'), out_dir)
- wast2wasm.RunWithArgs(options.file, '-o', out_file)
+ wat2wasm.RunWithArgs(options.file, '-o', out_file)
wasm_opcodecnt.RunWithArgs(out_file, '-c', str(options.cutoff))
return 0
diff --git a/test/run-roundtrip.py b/test/run-roundtrip.py
index 47245f57..bce745c5 100755
--- a/test/run-roundtrip.py
+++ b/test/run-roundtrip.py
@@ -57,32 +57,32 @@ def FilesAreEqual(filename1, filename2, verbose=False):
return (OK, '')
-def TwoRoundtrips(wast2wasm, wasm2wat, out_dir, filename, verbose):
+def TwoRoundtrips(wat2wasm, wasm2wat, out_dir, filename, verbose):
basename = os.path.basename(filename)
basename_noext = os.path.splitext(basename)[0]
wasm1_file = os.path.join(out_dir, basename_noext + '-1.wasm')
wast2_file = os.path.join(out_dir, basename_noext + '-2.wast')
wasm3_file = os.path.join(out_dir, basename_noext + '-3.wasm')
try:
- wast2wasm.RunWithArgs('-o', wasm1_file, filename)
+ wat2wasm.RunWithArgs('-o', wasm1_file, filename)
except Error as e:
# if the file doesn't parse properly, just skip it (it may be a "bad-*"
# test)
return (SKIPPED, None)
try:
wasm2wat.RunWithArgs('-o', wast2_file, wasm1_file)
- wast2wasm.RunWithArgs('-o', wasm3_file, wast2_file)
+ wat2wasm.RunWithArgs('-o', wasm3_file, wast2_file)
except Error as e:
return (ERROR, str(e))
return FilesAreEqual(wasm1_file, wasm3_file, verbose)
-def OneRoundtripToStdout(wast2wasm, wasm2wat, out_dir, filename, verbose):
+def OneRoundtripToStdout(wat2wasm, wasm2wat, out_dir, filename, verbose):
basename = os.path.basename(filename)
basename_noext = os.path.splitext(basename)[0]
wasm_file = os.path.join(out_dir, basename_noext + '.wasm')
try:
- wast2wasm.RunWithArgs('-o', wasm_file, filename)
+ wat2wasm.RunWithArgs('-o', wasm_file, filename)
except Error as e:
# if the file doesn't parse properly, just skip it (it may be a "bad-*"
# test)
@@ -121,10 +121,10 @@ def main(args):
parser.add_argument('file', help='test file.')
options = parser.parse_args(args)
- wast2wasm = utils.Executable(
- find_exe.GetWast2WasmExecutable(options.bindir),
+ wat2wasm = utils.Executable(
+ find_exe.GetWat2WasmExecutable(options.bindir),
error_cmdline=options.error_cmdline)
- wast2wasm.AppendOptionalArgs({
+ wat2wasm.AppendOptionalArgs({
'--debug-names': options.debug_names,
'--enable-exceptions': options.enable_exceptions,
'--no-check': options.no_check,
@@ -142,7 +142,7 @@ def main(args):
'--no-check': options.no_check,
})
- wast2wasm.verbose = options.print_cmd
+ wat2wasm.verbose = options.print_cmd
wasm2wat.verbose = options.print_cmd
filename = options.file
@@ -152,10 +152,10 @@ def main(args):
with utils.TempDirectory(options.out_dir, 'roundtrip-') as out_dir:
if options.stdout:
- result, msg = OneRoundtripToStdout(wast2wasm, wasm2wat, out_dir,
+ result, msg = OneRoundtripToStdout(wat2wasm, wasm2wat, out_dir,
filename, options.verbose)
else:
- result, msg = TwoRoundtrips(wast2wasm, wasm2wat, out_dir, filename,
+ result, msg = TwoRoundtrips(wat2wasm, wasm2wat, out_dir, filename,
options.verbose)
if result == ERROR:
sys.stderr.write(msg)
diff --git a/test/run-tests.py b/test/run-tests.py
index 0d6b9405..07e3d22b 100755
--- a/test/run-tests.py
+++ b/test/run-tests.py
@@ -42,8 +42,12 @@ SLOW_TIMEOUT_MULTIPLIER = 2
# default configurations for tests
TOOLS = {
- 'wast2wasm': {
- 'EXE': '%(wast2wasm)s',
+ 'wat2wasm': {
+ 'EXE': '%(wat2wasm)s',
+ 'VERBOSE-FLAGS': ['-v']
+ },
+ 'wast2json': {
+ 'EXE': '%(wast2json)s',
'VERBOSE-FLAGS': ['-v']
},
'wast-desugar': {
@@ -139,7 +143,7 @@ TOOLS = {
},
}
-ROUNDTRIP_TOOLS = ('wast2wasm',)
+ROUNDTRIP_TOOLS = ('wat2wasm',)
def Indent(s, spaces):
@@ -228,8 +232,8 @@ class TestInfo(object):
self.input_ = ''
self.expected_stdout = ''
self.expected_stderr = ''
- self.tool = 'wast2wasm'
- self.exe = '%(wast2wasm)s'
+ self.tool = 'wat2wasm'
+ self.exe = '%(wat2wasm)s'
self.flags = []
self.env = {}
self.last_cmd = ''
diff --git a/test/run-wasm-link.py b/test/run-wasm-link.py
index 0387fa50..6fb24b1b 100755
--- a/test/run-wasm-link.py
+++ b/test/run-wasm-link.py
@@ -53,10 +53,10 @@ def main(args):
parser.add_argument('file', help='test file.')
options = parser.parse_args(args)
- wast2wasm = utils.Executable(
- find_exe.GetWast2WasmExecutable(options.bindir),
+ wast2json = utils.Executable(
+ find_exe.GetWast2JsonExecutable(options.bindir),
error_cmdline=options.error_cmdline)
- wast2wasm.AppendOptionalArgs({
+ wast2json.AppendOptionalArgs({
'--debug-names': options.debug_names,
'-v': options.dump_verbose,
})
@@ -76,7 +76,7 @@ def main(args):
wasm_interp = utils.Executable(find_exe.GetWasmInterpExecutable(
options.bindir), error_cmdline=options.error_cmdline)
- wast2wasm.verbose = options.print_cmd
+ wast2json.verbose = options.print_cmd
wasm_link.verbose = options.print_cmd
wasm_objdump.verbose = options.print_cmd
wasm_interp.verbose = options.print_cmd
@@ -87,7 +87,7 @@ def main(args):
basename = os.path.basename(filename)
basename_noext = os.path.splitext(basename)[0]
out_file = os.path.join(out_dir, basename_noext + '.json')
- wast2wasm.RunWithArgs('--spec', '--debug-names', '--no-check', '-r', '-o',
+ wast2json.RunWithArgs('--debug-names', '--no-check', '-r', '-o',
out_file, filename)
wasm_files = utils.GetModuleFilenamesFromSpecJSON(out_file)
diff --git a/test/too-many-arguments.txt b/test/too-many-arguments.txt
index 9189b729..e3de62ec 100644
--- a/test/too-many-arguments.txt
+++ b/test/too-many-arguments.txt
@@ -1,4 +1,4 @@
-;;; EXE: %(wast2wasm)s
+;;; EXE: %(wat2wasm)s
;;; FLAGS: foo.txt bar.txt
;;; ERROR: 1
(;; STDERR ;;;
diff --git a/test/typecheck/bad-assertreturn-invoke-type-mismatch.txt b/test/typecheck/bad-assertreturn-invoke-type-mismatch.txt
index 4766e227..95478b1e 100644
--- a/test/typecheck/bad-assertreturn-invoke-type-mismatch.txt
+++ b/test/typecheck/bad-assertreturn-invoke-type-mismatch.txt
@@ -1,5 +1,5 @@
+;;; TOOL: wast2json
;;; ERROR: 1
-;;; FLAGS: --spec
(module
(func (param i32) (result i32) get_local 0)
(export "foo" 0))
diff --git a/test/typecheck/bad-assertreturn-type-mismatch.txt b/test/typecheck/bad-assertreturn-type-mismatch.txt
index 0e81db7c..1cbf9f31 100644
--- a/test/typecheck/bad-assertreturn-type-mismatch.txt
+++ b/test/typecheck/bad-assertreturn-type-mismatch.txt
@@ -1,5 +1,5 @@
+;;; TOOL: wast2json
;;; ERROR: 1
-;;; FLAGS: --spec
(module
(func (param i32) (result i32) get_local 0)
(export "foo" 0))
diff --git a/test/typecheck/bad-invoke-type-mismatch.txt b/test/typecheck/bad-invoke-type-mismatch.txt
index c4e89dc2..56f32097 100644
--- a/test/typecheck/bad-invoke-type-mismatch.txt
+++ b/test/typecheck/bad-invoke-type-mismatch.txt
@@ -1,5 +1,5 @@
+;;; TOOL: wast2json
;;; ERROR: 1
-;;; FLAGS: --spec
(module
(func (param i32))
(export "foo" 0))