diff options
author | Thomas Lively <7121787+tlively@users.noreply.github.com> | 2021-05-18 19:33:58 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-19 02:33:58 +0000 |
commit | f308e37f42c33d18bafbbbf821a70a1ca2d7e655 (patch) | |
tree | 26ae7b0d01e83912fb311a09350c022f3c80a240 /test/lit/wasm-split | |
parent | 8099dd859dc2732bea9b9f0c56440bb34a4d22c3 (diff) | |
download | binaryen-f308e37f42c33d18bafbbbf821a70a1ca2d7e655.tar.gz binaryen-f308e37f42c33d18bafbbbf821a70a1ca2d7e655.tar.bz2 binaryen-f308e37f42c33d18bafbbbf821a70a1ca2d7e655.zip |
[wasm-split] Add a --symbolmap option (#3894)
The new option emits a symbol map file for each of the split modules. The file
names are created by appending ".symbols" to each of the Wasm output file
names.
Diffstat (limited to 'test/lit/wasm-split')
-rw-r--r-- | test/lit/wasm-split/invalid-options.wast | 6 | ||||
-rw-r--r-- | test/lit/wasm-split/symbolmap.wast | 24 |
2 files changed, 30 insertions, 0 deletions
diff --git a/test/lit/wasm-split/invalid-options.wast b/test/lit/wasm-split/invalid-options.wast index 20e74196d..32899b87b 100644 --- a/test/lit/wasm-split/invalid-options.wast +++ b/test/lit/wasm-split/invalid-options.wast @@ -13,6 +13,10 @@ ;; RUN: not wasm-split %s --instrument -o2 %t 2>&1 \ ;; RUN: | filecheck %s --check-prefix INSTRUMENT-OUT2 +;; --instrument cannot be used with --symbolmap +;; RUN: not wasm-split %s --instrument --symbolmap 2>&1 \ +;; RUN: | filecheck %s --check-prefix INSTRUMENT-SYMBOLMAP + ;; --instrument cannot be used with --import-namespace ;; RUN: not wasm-split %s --instrument --import-namespace=foo 2>&1 \ ;; RUN: | filecheck %s --check-prefix INSTRUMENT-IMPORT-NS @@ -47,6 +51,8 @@ ;; INSTRUMENT-OUT2: error: secondary output cannot be used with --instrument +;; INSTRUMENT-SYMBOLMAP: error: --symbolmap cannot be used with --instrument + ;; INSTRUMENT-IMPORT-NS: error: --import-namespace cannot be used with --instrument ;; INSTRUMENT-PLACEHOLDER-NS: error: --placeholder-namespace cannot be used with --instrument diff --git a/test/lit/wasm-split/symbolmap.wast b/test/lit/wasm-split/symbolmap.wast new file mode 100644 index 000000000..4fe0f5291 --- /dev/null +++ b/test/lit/wasm-split/symbolmap.wast @@ -0,0 +1,24 @@ +;; RUN: wasm-split %s --keep-funcs=bar -o1 %t.1.wasm -o2 %t.2.wasm --symbolmap +;; RUN: filecheck %s --check-prefix PRIMARY-MAP < %t.1.wasm.symbols +;; RUN: filecheck %s --check-prefix SECONDARY-MAP < %t.2.wasm.symbols +;; RUN: wasm-dis %t.1.wasm | filecheck %s --check-prefix PRIMARY + +;; PRIMARY-MAP: 0:bar + +;; SECONDARY-MAP: 0:baz +;; SECONDARY-MAP: 1:foo + +;; Check that the names have been stripped. +;; PRIMARY: (func $0 + +(module + (func $foo + (nop) + ) + (func $bar + (nop) + ) + (func $baz + (nop) + ) +) |