Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions test/lit/help/wasm-merge.test
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
;; CHECK-NEXT:
;; CHECK-NEXT: Note that filenames and modules names are interleaved (which is hopefully less
;; CHECK-NEXT: confusing).
;; CHECK-NEXT:
;; CHECK-NEXT: Input source maps can be specified by adding an -ism option right after the
;; CHECK-NEXT: module name:
;; CHECK-NEXT:
;; CHECK-NEXT: wasm-merge foo.wasm foo -ism foo.wasm.map ...
;; CHECK-NEXT:
;; CHECK-NEXT: Input source maps can be specified by adding an -ism option right after the
;; CHECK-NEXT: module name:
;; CHECK-NEXT:
;; CHECK-NEXT: wasm-merge foo.wasm foo -ism foo.wasm.map ...
;; CHECK-NEXT: ================================================================================
;; CHECK-NEXT:
;; CHECK-NEXT:
Expand All @@ -28,7 +28,7 @@
;; CHECK-NEXT: --output,-o Output file (stdout if not specified)
;; CHECK-NEXT:
;; CHECK-NEXT: --input-source-map,-ism Consume source maps from the specified
;; CHECK-NEXT: file
;; CHECK-NEXT: files
;; CHECK-NEXT:
;; CHECK-NEXT: --output-source-map,-osm Emit source map to the specified file
;; CHECK-NEXT:
Expand Down
12 changes: 4 additions & 8 deletions test/lit/merge/sourcemap.wat
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,13 @@

;; CHECK-TEXT: (export "g" (func $0_1))

;; CHECK-TEXT: ;;@ a:1:1
;; CHECK-TEXT-NEXT: (func $0
;; CHECK-TEXT: (func $0
;; CHECK-TEXT-NEXT: ;;@ a:2:1
;; CHECK-TEXT-NEXT: (nop)
;; CHECK-TEXT-NEXT: ;;@ a:3:1
;; CHECK-TEXT-NEXT: )

;; CHECK-TEXT: ;;@ b:1:2
;; CHECK-TEXT-NEXT: (func $0_1
;; CHECK-TEXT: (func $0_1
;; CHECK-TEXT-NEXT: ;;@ b:2:2
;; CHECK-TEXT-NEXT: (nop)
;; CHECK-TEXT-NEXT: ;;@ b:3:2
Expand All @@ -42,15 +40,13 @@

;; CHECK-BIN: (export "g" (func $1))

;; CHECK-BIN: ;;@ a:1:1
;; CHECK-BIN-NEXT: (func $0
;; CHECK-BIN: (func $0
;; CHECK-BIN-NEXT: ;;@ a:2:1
;; CHECK-BIN-NEXT: (nop)
;; CHECK-BIN-NEXT: ;;@ a:3:1
;; CHECK-BIN-NEXT: )

;; CHECK-BIN: ;;@ b:1:2
;; CHECK-BIN-NEXT: (func $1
;; CHECK-BIN: (func $1
;; CHECK-BIN-NEXT: ;;@ b:2:2
;; CHECK-BIN-NEXT: (nop)
;; CHECK-BIN-NEXT: ;;@ b:3:2
Expand Down
32 changes: 20 additions & 12 deletions test/lit/metadce/sourcemap.wat
Original file line number Diff line number Diff line change
@@ -1,26 +1,34 @@
;; NOTE: Assertions have been generated by update_lit_checks.py and should not be edited.
;; RUN: wasm-metadce %s --graph-file %s.json -S -o - | filecheck %s
;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited.
;; RUN: wasm-metadce %s --graph-file %s.json -S -o - | filecheck %s --check-prefix=TXT
;; RUN: wasm-as %s -o %t.wasm --source-map %t.map
;; RUN: wasm-metadce %t.wasm --input-source-map %t.map --graph-file %s.json -o %t.out.wasm --output-source-map %t.out.map
;; RUN: wasm-dis %t.out.wasm --source-map %t.out.map -o - | filecheck %s
;; RUN: wasm-dis %t.out.wasm --source-map %t.out.map -o - | filecheck %s --check-prefix=BIN

;; Test that sourcemap information is preserved

(module
;;@ a:1:1
(func (export "f")
;; TXT: (type $0 (func))

;; TXT: (export "f" (func $f))

;; TXT: (func $f
;; TXT-NEXT: ;;@ a:2:1
;; TXT-NEXT: (nop)
;; TXT-NEXT: ;;@ a:3:1
;; TXT-NEXT: )
(func $f (export "f")
;;@ a:2:1
(nop)
;;@ a:3:1
)
)
;; CHECK: (type $0 (func))
;; BIN: (type $0 (func))

;; CHECK: (export "f" (func $0))
;; BIN: (export "f" (func $0))

;; CHECK: ;;@ a:1:1
;; CHECK-NEXT: (func $0
;; CHECK-NEXT: ;;@ a:2:1
;; CHECK-NEXT: (nop)
;; CHECK-NEXT: ;;@ a:3:1
;; CHECK-NEXT: )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this test lost all its testing - should it be a manual test perhaps? But why is this CHECK output vanishing - is it hitting an auto updater bug perhaps?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the function just needs to be named so that the update script can recognize it and match it up with the output. That's enough to test everything except the prologue source comment, which the update script does not know to emit.

;; BIN: (func $0
;; BIN-NEXT: ;;@ a:2:1
;; BIN-NEXT: (nop)
;; BIN-NEXT: ;;@ a:3:1
;; BIN-NEXT: )