summaryrefslogtreecommitdiff
path: root/test/lit/wasm-split
diff options
context:
space:
mode:
authorThomas Lively <7121787+tlively@users.noreply.github.com>2021-09-08 13:13:33 -0700
committerGitHub <noreply@github.com>2021-09-08 13:13:33 -0700
commitd3e70f90d5b6ca975af8f19f171e4190d3652913 (patch)
tree3a619c28ede041d06197eda2081f486f81c455c5 /test/lit/wasm-split
parente7de93e58f2c5cfdfc136285b29d84b1f8a559cb (diff)
downloadbinaryen-d3e70f90d5b6ca975af8f19f171e4190d3652913.tar.gz
binaryen-d3e70f90d5b6ca975af8f19f171e4190d3652913.tar.bz2
binaryen-d3e70f90d5b6ca975af8f19f171e4190d3652913.zip
[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.
Diffstat (limited to 'test/lit/wasm-split')
-rw-r--r--test/lit/wasm-split/imported-memory.wast12
1 files changed, 12 insertions, 0 deletions
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))