summaryrefslogtreecommitdiff
path: root/test/lit/wasm-split/profile-guided.wast
diff options
context:
space:
mode:
Diffstat (limited to 'test/lit/wasm-split/profile-guided.wast')
-rw-r--r--test/lit/wasm-split/profile-guided.wast19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/lit/wasm-split/profile-guided.wast b/test/lit/wasm-split/profile-guided.wast
index 6828c19fc..709ff4c8f 100644
--- a/test/lit/wasm-split/profile-guided.wast
+++ b/test/lit/wasm-split/profile-guided.wast
@@ -25,6 +25,12 @@
;; RUN: wasm-split -all %s --profile=%t.none.prof -v -o1 %t.none.1.wasm -o2 %t.none.2.wasm \
;; RUN: | filecheck %s --check-prefix NONE
+;; RUN: wasm-split -all %s --profile=%t.bar.prof --keep-funcs=uncalled -v -o1 %t.bar.1.wasm -o2 %t.bar.2.wasm \
+;; RUN: | filecheck %s --check-prefix PROFILE_KEEP
+
+;; RUN: wasm-split -all %s --profile=%t.both.prof --split-funcs=shared_callee -v -o1 %t.both.1.wasm -o2 %t.both.2.wasm 2>&1 \
+;; RUN: | filecheck %s --check-prefix PROFILE_SPLIT
+
;; =================================
;; Do it all again using --in-memory
;; =================================
@@ -52,6 +58,12 @@
;; RUN: wasm-split -all %s --profile=%t.none.prof -v -o1 %t.none.1.wasm -o2 %t.none.2.wasm \
;; RUN: | filecheck %s --check-prefix NONE
+;; RUN: wasm-split -all %s --profile=%t.bar.prof --keep-funcs=uncalled -v -o1 %t.bar.1.wasm -o2 %t.bar.2.wasm \
+;; RUN: | filecheck %s --check-prefix PROFILE_KEEP
+
+;; RUN: wasm-split -all %s --profile=%t.both.prof --split-funcs=shared_callee -v -o1 %t.both.1.wasm -o2 %t.both.2.wasm 2>&1 \
+;; RUN: | filecheck %s --check-prefix PROFILE_SPLIT
+
;; =======
;; Results
;; =======
@@ -68,6 +80,13 @@
;; NONE: Keeping functions:
;; NONE: Splitting out functions: bar, bar_callee, deep_foo_callee, foo, foo_callee, shared_callee, uncalled
+;; PROFILE_KEEP: Keeping functions: bar, bar_callee, shared_callee, uncalled
+;; PROFILE_KEEP: Splitting out functions: deep_foo_callee, foo, foo_callee
+
+;; PROFILE_SPLIT: warning: function shared_callee was to be kept in primary module. However it will now be split out into secondary module.
+;; PROFILE_SPLIT: Keeping functions: bar, bar_callee, deep_foo_callee, foo, foo_callee
+;; PROFILE_SPLIT: Splitting out functions: shared_callee, uncalled
+
(module
(memory $mem 1 1 shared)
(export "memory" (memory $mem))