summaryrefslogtreecommitdiff
path: root/test/metadce
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2021-10-14 15:42:55 -0700
committerGitHub <noreply@github.com>2021-10-14 15:42:55 -0700
commit0a1ac51b1e7e88f0ce89793c71333bb8bc7335d0 (patch)
tree3e42e4162b94fe537ca0260e236044d80c9ac06c /test/metadce
parentbf665976b1526ca7cf11bacf5745563dfe193206 (diff)
downloadbinaryen-0a1ac51b1e7e88f0ce89793c71333bb8bc7335d0.tar.gz
binaryen-0a1ac51b1e7e88f0ce89793c71333bb8bc7335d0.tar.bz2
binaryen-0a1ac51b1e7e88f0ce89793c71333bb8bc7335d0.zip
[wasm-metadce] Add support for tags (#4250)
This adds support for tag-using instructions (`throw` and `catch`) to wasm-metadce. We had to use a hacky workaround in emscripten-core/emscripten#15266 because of the lack of this support; after this lands we can remove it.
Diffstat (limited to 'test/metadce')
-rw-r--r--test/metadce/tag.wast14
-rw-r--r--test/metadce/tag.wast.dced16
-rw-r--r--test/metadce/tag.wast.dced.stdout0
-rw-r--r--test/metadce/tag.wast.graph.txt11
4 files changed, 41 insertions, 0 deletions
diff --git a/test/metadce/tag.wast b/test/metadce/tag.wast
new file mode 100644
index 000000000..527e57d33
--- /dev/null
+++ b/test/metadce/tag.wast
@@ -0,0 +1,14 @@
+(module
+ (import "env" "imported_tag" (tag $t0))
+ (tag $t1)
+ (export "test" (func $test))
+
+ (func $test
+ (try
+ (do
+ (throw $t0)
+ )
+ (catch $t1)
+ )
+ )
+)
diff --git a/test/metadce/tag.wast.dced b/test/metadce/tag.wast.dced
new file mode 100644
index 000000000..78ae287f1
--- /dev/null
+++ b/test/metadce/tag.wast.dced
@@ -0,0 +1,16 @@
+(module
+ (type $none_=>_none (func))
+ (import "env" "imported_tag" (tag $t0 (param)))
+ (tag $t1 (param))
+ (export "test" (func $test))
+ (func $test
+ (try $try
+ (do
+ (throw $t0)
+ )
+ (catch $t1
+ (nop)
+ )
+ )
+ )
+)
diff --git a/test/metadce/tag.wast.dced.stdout b/test/metadce/tag.wast.dced.stdout
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/test/metadce/tag.wast.dced.stdout
diff --git a/test/metadce/tag.wast.graph.txt b/test/metadce/tag.wast.graph.txt
new file mode 100644
index 000000000..34a2d1fdf
--- /dev/null
+++ b/test/metadce/tag.wast.graph.txt
@@ -0,0 +1,11 @@
+[
+ {
+ "name": "tag_import",
+ "import": ["env", "imported_tag"]
+ },
+ {
+ "name": "func_export",
+ "root": true,
+ "export": "test"
+ }
+]