From f308e37f42c33d18bafbbbf821a70a1ca2d7e655 Mon Sep 17 00:00:00 2001 From: Thomas Lively <7121787+tlively@users.noreply.github.com> Date: Tue, 18 May 2021 19:33:58 -0700 Subject: [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. --- test/lit/wasm-split/invalid-options.wast | 6 ++++++ test/lit/wasm-split/symbolmap.wast | 24 ++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 test/lit/wasm-split/symbolmap.wast (limited to 'test/lit/wasm-split') 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) + ) +) -- cgit v1.2.3