summaryrefslogtreecommitdiff
path: root/test/lit/binary
diff options
context:
space:
mode:
Diffstat (limited to 'test/lit/binary')
-rw-r--r--test/lit/binary/bad-delegate.test17
-rw-r--r--test/lit/binary/bad-delegate.test.wasmbin0 -> 32 bytes
2 files changed, 17 insertions, 0 deletions
diff --git a/test/lit/binary/bad-delegate.test b/test/lit/binary/bad-delegate.test
new file mode 100644
index 000000000..8e6a011a5
--- /dev/null
+++ b/test/lit/binary/bad-delegate.test
@@ -0,0 +1,17 @@
+;; Test that we error properly on a file with a bad delegate (a delegate of an
+;; index that does not refer to a valid try-catch).
+
+;; Disassembled binary from wabt:
+;;
+;; (module
+;; (type (;0;) (func))
+;; (func (;0;) (type 0)
+;; block ;; label = @1
+;; try ;; label = @2
+;; nop
+;; delegate 0
+;; end))
+
+;; RUN: not wasm-opt -all %s.wasm 2>&1 | filecheck %s
+
+;; CHECK: exceptionTargetNames not empty - invalid delegate
diff --git a/test/lit/binary/bad-delegate.test.wasm b/test/lit/binary/bad-delegate.test.wasm
new file mode 100644
index 000000000..db9645e35
--- /dev/null
+++ b/test/lit/binary/bad-delegate.test.wasm
Binary files differ