From d3e70f90d5b6ca975af8f19f171e4190d3652913 Mon Sep 17 00:00:00 2001 From: Thomas Lively <7121787+tlively@users.noreply.github.com> Date: Wed, 8 Sep 2021 13:13:33 -0700 Subject: [wasm-split] Do not add exports of imported memories (#4133) We can assume that imported memories (and the profiling data they contain) are already accessible from the module's environment, so there's no need to export them. This also avoids needing to add knowledge of "profile-memory" to Emscripten's library_dylink.js. --- test/lit/wasm-split/imported-memory.wast | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 test/lit/wasm-split/imported-memory.wast (limited to 'test/lit/wasm-split') diff --git a/test/lit/wasm-split/imported-memory.wast b/test/lit/wasm-split/imported-memory.wast new file mode 100644 index 000000000..39e2a0073 --- /dev/null +++ b/test/lit/wasm-split/imported-memory.wast @@ -0,0 +1,12 @@ +;; RUN: wasm-split --instrument %s -all -S -o - | filecheck %s + +;; Check that an imported memory is not exported as "profile-memory" + +(module + (import "env" "mem" (memory $mem 1 1)) +) + +;; CHECK: (import "env" "mem" (memory $mem 1 1)) +;; CHECK: (export "__write_profile" (func $__write_profile)) + +;; CHECK-NOT: (export "profile-memory" (memory $mem)) -- cgit v1.2.3