summaryrefslogtreecommitdiff
path: root/test/typecheck
diff options
context:
space:
mode:
authorAsumu Takikawa <asumu@igalia.com>2021-02-18 07:09:32 -0800
committerGitHub <noreply@github.com>2021-02-18 07:09:32 -0800
commitffb22e3c900e8246d806d2e9a765dc14251b33e8 (patch)
tree45c7d2caef95ac03b237e8b3c2f29fe1db9686b6 /test/typecheck
parent036a632a24679062e7fc891e7743195139bfa0a9 (diff)
downloadwabt-ffb22e3c900e8246d806d2e9a765dc14251b33e8.tar.gz
wabt-ffb22e3c900e8246d806d2e9a765dc14251b33e8.tar.bz2
wabt-ffb22e3c900e8246d806d2e9a765dc14251b33e8.zip
Update rethrow depth handling and catch_all opcode (#1608)
Give `catch_all` its own opcode: Previously `catch_all` shared an opcode with `else`, but the spec now allocates it the 0x19 opcode. Adjust rethrow depth semantics: Previously this had interpreted the rethrow depth argument as counting only catch blocks, but the spec has clarified that it should count all blocks (in a similar fashion as `br` and related instructions).
Diffstat (limited to 'test/typecheck')
-rw-r--r--test/typecheck/bad-rethrow-depth.txt49
-rw-r--r--test/typecheck/rethrow.txt47
2 files changed, 77 insertions, 19 deletions
diff --git a/test/typecheck/bad-rethrow-depth.txt b/test/typecheck/bad-rethrow-depth.txt
index 6740771d..fb7ef4a2 100644
--- a/test/typecheck/bad-rethrow-depth.txt
+++ b/test/typecheck/bad-rethrow-depth.txt
@@ -4,19 +4,52 @@
(module
(event $e)
(func
- try
+ try $l1
nop
catch $e
- block
- try
+ block $l2
+ try $l3
nop
catch $e
- rethrow 2
+ try $l4
+ rethrow $l4
+ rethrow 0
+ rethrow $l2
+ rethrow 2
+ catch $e
+ rethrow $l2
+ rethrow 2
+ end
end
end
- end))
+ end)
+
+ (func
+ try
+ unwind
+ rethrow 0
+ end)
+ )
(;; STDERR ;;;
-out/test/typecheck/bad-rethrow-depth.txt:14:11: error: invalid rethrow depth: 2 (catches: 0, 1)
- rethrow 2
- ^^^^^^^
+out/test/typecheck/bad-rethrow-depth.txt:15:13: error: invalid rethrow depth: 0 (catches: 1, 3)
+ rethrow $l4
+ ^^^^^^^
+out/test/typecheck/bad-rethrow-depth.txt:16:13: error: invalid rethrow depth: 0 (catches: 1, 3)
+ rethrow 0
+ ^^^^^^^
+out/test/typecheck/bad-rethrow-depth.txt:17:13: error: invalid rethrow depth: 2 (catches: 1, 3)
+ rethrow $l2
+ ^^^^^^^
+out/test/typecheck/bad-rethrow-depth.txt:18:13: error: invalid rethrow depth: 2 (catches: 1, 3)
+ rethrow 2
+ ^^^^^^^
+out/test/typecheck/bad-rethrow-depth.txt:20:13: error: invalid rethrow depth: 2 (catches: 0, 1, 3)
+ rethrow $l2
+ ^^^^^^^
+out/test/typecheck/bad-rethrow-depth.txt:21:13: error: invalid rethrow depth: 2 (catches: 0, 1, 3)
+ rethrow 2
+ ^^^^^^^
+out/test/typecheck/bad-rethrow-depth.txt:30:7: error: rethrow not in try catch block
+ rethrow 0
+ ^^^^^^^
;;; STDERR ;;)
diff --git a/test/typecheck/rethrow.txt b/test/typecheck/rethrow.txt
index 8b389364..0ba4e465 100644
--- a/test/typecheck/rethrow.txt
+++ b/test/typecheck/rethrow.txt
@@ -3,27 +3,52 @@
(module
(event $e)
(func
- try
+ try $l1
nop
catch $e
- block
- try
+ block $l2
+ try $l3
nop
catch $e
- rethrow 0
+ try $l4
+ rethrow $l3
+ rethrow 1
+ rethrow $l1
+ rethrow 3
+ catch $e
+ rethrow $l4
+ rethrow 0
+ rethrow $l3
+ rethrow 1
+ rethrow $l1
+ rethrow 3
+ end
end
end
end)
(func
- try
+ try $l1
nop
- catch $e
- block
- try
+ catch_all
+ block $l2
+ try $l3
nop
- catch $e
- rethrow 1
+ catch_all
+ try $l4
+ rethrow $l3
+ rethrow 1
+ rethrow $l1
+ rethrow 3
+ catch_all
+ rethrow $l4
+ rethrow 0
+ rethrow $l3
+ rethrow 1
+ rethrow $l1
+ rethrow 3
+ end
end
end
- end))
+ end)
+ )