-
Notifications
You must be signed in to change notification settings - Fork 753
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add sourcemap support to wasm-metadce and wasm-merge (#6372)
- Loading branch information
Showing
12 changed files
with
271 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited. | ||
|
||
;; RUN: wasm-merge %s first %s.second second -S -o - | filecheck %s --check-prefix=CHECK-TEXT | ||
;; RUN: wasm-as %s -o %t.wasm --source-map %t.map | ||
;; RUN: wasm-as %s.second -o %t.second.wasm --source-map %t.second.map | ||
;; RUN: wasm-merge %t.wasm first --input-source-map %t.map %t.second.wasm second --input-source-map %t.second.map -o %t.merged.wasm --output-source-map %t.merged.map | ||
;; RUN: wasm-dis %t.merged.wasm --source-map %t.merged.map -o - | filecheck %s --check-prefix=CHECK-BIN | ||
|
||
;; Test that sourcemap information is preserved | ||
|
||
(module | ||
;;@ a:1:1 | ||
(func (export "f") | ||
;;@ a:2:1 | ||
(nop) | ||
;;@ a:3:1 | ||
) | ||
) | ||
;; CHECK-TEXT: (type $0 (func)) | ||
|
||
;; CHECK-TEXT: (export "f" (func $0)) | ||
|
||
;; CHECK-TEXT: (export "g" (func $0_1)) | ||
|
||
;; CHECK-TEXT: ;;@ a:1:1 | ||
;; CHECK-TEXT-NEXT: (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-NEXT: ;;@ b:2:2 | ||
;; CHECK-TEXT-NEXT: (nop) | ||
;; CHECK-TEXT-NEXT: ;;@ b:3:2 | ||
;; CHECK-TEXT-NEXT: ) | ||
|
||
;; CHECK-BIN: (type $0 (func)) | ||
|
||
;; CHECK-BIN: (export "f" (func $0)) | ||
|
||
;; CHECK-BIN: (export "g" (func $1)) | ||
|
||
;; CHECK-BIN: ;;@ a:1:1 | ||
;; CHECK-BIN-NEXT: (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-NEXT: ;;@ b:2:2 | ||
;; CHECK-BIN-NEXT: (nop) | ||
;; CHECK-BIN-NEXT: ;;@ b:3:2 | ||
;; CHECK-BIN-NEXT: ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
(module | ||
;;@ b:1:2 | ||
(func (export "g") | ||
;;@ b:2:2 | ||
(nop) | ||
;;@ b:3:2 | ||
) | ||
) |
Oops, something went wrong.