diff options
author | Heejin Ahn <aheejin@gmail.com> | 2021-10-14 15:42:55 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-14 15:42:55 -0700 |
commit | 0a1ac51b1e7e88f0ce89793c71333bb8bc7335d0 (patch) | |
tree | 3e42e4162b94fe537ca0260e236044d80c9ac06c /test/metadce | |
parent | bf665976b1526ca7cf11bacf5745563dfe193206 (diff) | |
download | binaryen-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.wast | 14 | ||||
-rw-r--r-- | test/metadce/tag.wast.dced | 16 | ||||
-rw-r--r-- | test/metadce/tag.wast.dced.stdout | 0 | ||||
-rw-r--r-- | test/metadce/tag.wast.graph.txt | 11 |
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" + } +] |