diff options
author | Jérôme Vouillon <jerome.vouillon@gmail.com> | 2023-07-17 18:22:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-17 09:22:49 -0700 |
commit | a715c5f344d170c469dddd1c4d7852fa79dc2f06 (patch) | |
tree | c50f41b17f59fd99dbce0ee64a076437bfd57f45 /test/lit/merge/import_cycle.wat | |
parent | 2fe4e6a7ac0f8aafe80555b91f3dec9190ad917f (diff) | |
download | binaryen-a715c5f344d170c469dddd1c4d7852fa79dc2f06.tar.gz binaryen-a715c5f344d170c469dddd1c4d7852fa79dc2f06.tar.bz2 binaryen-a715c5f344d170c469dddd1c4d7852fa79dc2f06.zip |
[wasm-merge] Handle chains of import/export (#5813)
When a module item is imported and directly reexported by an
intermediate module, we need to perform several name lookups and use its
name in the initial module rather than the intermediate name when fusing
imports and exports.
Diffstat (limited to 'test/lit/merge/import_cycle.wat')
-rw-r--r-- | test/lit/merge/import_cycle.wat | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/lit/merge/import_cycle.wat b/test/lit/merge/import_cycle.wat new file mode 100644 index 000000000..0261eabc5 --- /dev/null +++ b/test/lit/merge/import_cycle.wat @@ -0,0 +1,16 @@ +;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited. +;; RUN: wasm-merge %s first %s.second second -S -o - | filecheck %s + +;; Test that wasm-merge terminates when there are importation cycles + +(module + ;; CHECK: (type $none_=>_none (func)) + + ;; CHECK: (import "second" "g" (func $f)) + (import "second" "g" (func $f)) + ;; CHECK: (import "first" "f" (func $f_1)) + + ;; CHECK: (export "f" (func $f_1)) + (export "f" (func $f)) +) +;; CHECK: (export "g" (func $f)) |