summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/exception-handling.wast16
-rw-r--r--test/exception-handling.wast.from-wast21
-rw-r--r--test/exception-handling.wast.fromBinary8
-rw-r--r--test/exception-handling.wast.fromBinary.noDebugInfo6
-rw-r--r--test/try-body-multiple-insts.wasmbin0 -> 49 bytes
-rw-r--r--test/try-body-multiple-insts.wasm.fromBinary26
6 files changed, 75 insertions, 2 deletions
diff --git a/test/exception-handling.wast b/test/exception-handling.wast
index cb3aee0d9..275350c61 100644
--- a/test/exception-handling.wast
+++ b/test/exception-handling.wast
@@ -5,6 +5,9 @@
(local.get $0)
)
+ (func $foo)
+ (func $bar)
+
(func $eh_test (local $exn exnref)
(try
(throw $e0 (i32.const 0))
@@ -36,5 +39,18 @@
(drop (exnref.pop))
)
)
+
+ ;; Multiple instructions within try and catch bodies
+ (try
+ (block
+ (call $foo)
+ (call $bar)
+ )
+ (catch
+ (drop (exnref.pop))
+ (call $foo)
+ (call $bar)
+ )
+ )
)
)
diff --git a/test/exception-handling.wast.from-wast b/test/exception-handling.wast.from-wast
index 7c431a89f..e3209518e 100644
--- a/test/exception-handling.wast.from-wast
+++ b/test/exception-handling.wast.from-wast
@@ -6,7 +6,13 @@
(func $exnref_test (; 0 ;) (type $FUNCSIG$ee) (param $0 exnref) (result exnref)
(local.get $0)
)
- (func $eh_test (; 1 ;) (type $FUNCSIG$v)
+ (func $foo (; 1 ;) (type $FUNCSIG$v)
+ (nop)
+ )
+ (func $bar (; 2 ;) (type $FUNCSIG$v)
+ (nop)
+ )
+ (func $eh_test (; 3 ;) (type $FUNCSIG$v)
(local $exn exnref)
(try
(throw $e0
@@ -43,5 +49,18 @@
)
)
)
+ (try
+ (block $block
+ (call $foo)
+ (call $bar)
+ )
+ (catch
+ (drop
+ (exnref.pop)
+ )
+ (call $foo)
+ (call $bar)
+ )
+ )
)
)
diff --git a/test/exception-handling.wast.fromBinary b/test/exception-handling.wast.fromBinary
index 1cff3d215..3151d1ea8 100644
--- a/test/exception-handling.wast.fromBinary
+++ b/test/exception-handling.wast.fromBinary
@@ -6,7 +6,13 @@
(func $exnref_test (; 0 ;) (type $0) (param $0 exnref) (result exnref)
(local.get $0)
)
- (func $eh_test (; 1 ;) (type $1)
+ (func $foo (; 1 ;) (type $1)
+ (nop)
+ )
+ (func $bar (; 2 ;) (type $1)
+ (nop)
+ )
+ (func $eh_test (; 3 ;) (type $1)
(local $0 exnref)
(try
(throw $event$0
diff --git a/test/exception-handling.wast.fromBinary.noDebugInfo b/test/exception-handling.wast.fromBinary.noDebugInfo
index 23ba7946c..3ef95033c 100644
--- a/test/exception-handling.wast.fromBinary.noDebugInfo
+++ b/test/exception-handling.wast.fromBinary.noDebugInfo
@@ -7,6 +7,12 @@
(local.get $0)
)
(func $1 (; 1 ;) (type $1)
+ (nop)
+ )
+ (func $2 (; 2 ;) (type $1)
+ (nop)
+ )
+ (func $3 (; 3 ;) (type $1)
(local $0 exnref)
(try
(throw $event$0
diff --git a/test/try-body-multiple-insts.wasm b/test/try-body-multiple-insts.wasm
new file mode 100644
index 000000000..dd67f3e52
--- /dev/null
+++ b/test/try-body-multiple-insts.wasm
Binary files differ
diff --git a/test/try-body-multiple-insts.wasm.fromBinary b/test/try-body-multiple-insts.wasm.fromBinary
new file mode 100644
index 000000000..f52a1a3dc
--- /dev/null
+++ b/test/try-body-multiple-insts.wasm.fromBinary
@@ -0,0 +1,26 @@
+(module
+ (type $0 (func))
+ (func $0 (; 0 ;) (type $0)
+ (nop)
+ )
+ (func $1 (; 1 ;) (type $0)
+ (nop)
+ )
+ (func $2 (; 2 ;) (type $0)
+ (local $0 exnref)
+ (try
+ (block
+ (call $0)
+ (call $1)
+ )
+ (catch
+ (drop
+ (exnref.pop)
+ )
+ (call $0)
+ (call $1)
+ )
+ )
+ )
+)
+