summaryrefslogtreecommitdiff
path: root/test/parse
diff options
context:
space:
mode:
authorAsumu Takikawa <asumu@igalia.com>2021-06-29 17:34:51 -0700
committerGitHub <noreply@github.com>2021-06-29 17:34:51 -0700
commit16ab43493237c8b82ccb411618f1679a9a321148 (patch)
tree5f3abbbc341834e2453e9ad17dcd7f80a87ee422 /test/parse
parent29323f09c63c48aef029ff308c39e1c1dc11d6c4 (diff)
downloadwabt-16ab43493237c8b82ccb411618f1679a9a321148.tar.gz
wabt-16ab43493237c8b82ccb411618f1679a9a321148.tar.bz2
wabt-16ab43493237c8b82ccb411618f1679a9a321148.zip
Allow plain `try` with no `catch` or `delegate` (#1676)
Matches recent changes in the exception handling spec that allowed this case to reduce special cases in the syntax: https://github.com/WebAssembly/exception-handling/pull/157
Diffstat (limited to 'test/parse')
-rw-r--r--test/parse/expr/bad-try-clause.txt10
-rw-r--r--test/parse/expr/bad-try-no-catch.txt14
-rw-r--r--test/parse/expr/try.txt6
3 files changed, 16 insertions, 14 deletions
diff --git a/test/parse/expr/bad-try-clause.txt b/test/parse/expr/bad-try-clause.txt
new file mode 100644
index 00000000..f8575c8c
--- /dev/null
+++ b/test/parse/expr/bad-try-clause.txt
@@ -0,0 +1,10 @@
+;;; TOOL: wat2wasm
+;;; ARGS: --enable-exceptions
+;;; ERROR: 1
+(module
+ (func (try (do) (foo)))
+(;; STDERR ;;;
+out/test/parse/expr/bad-try-clause.txt:5:20: error: unexpected token "foo", expected catch, catch_all or delegate.
+ (func (try (do) (foo)))
+ ^^^
+;;; STDERR ;;)
diff --git a/test/parse/expr/bad-try-no-catch.txt b/test/parse/expr/bad-try-no-catch.txt
deleted file mode 100644
index c85756fb..00000000
--- a/test/parse/expr/bad-try-no-catch.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-;;; TOOL: wat2wasm
-;;; ARGS: --enable-exceptions
-;;; ERROR: 1
-(module
- (func try nop end)
- (func (try (do nop))))
-(;; STDERR ;;;
-out/test/parse/expr/bad-try-no-catch.txt:5:17: error: unexpected token "end", expected catch, catch_all or delegate.
- (func try nop end)
- ^^^
-out/test/parse/expr/bad-try-no-catch.txt:6:22: error: unexpected token ), expected (.
- (func (try (do nop))))
- ^
-;;; STDERR ;;)
diff --git a/test/parse/expr/try.txt b/test/parse/expr/try.txt
index c10eebc2..51ed83b5 100644
--- a/test/parse/expr/try.txt
+++ b/test/parse/expr/try.txt
@@ -3,6 +3,12 @@
(module
(tag (param i32))
+ ;; no catch
+ (func
+ try
+ nop
+ end)
+
;; bare
(func
try