Skip to content

Commit

Permalink
Add wasm-merge test
Browse files Browse the repository at this point in the history
  • Loading branch information
vouillon committed Mar 2, 2024
1 parent 5a3caa4 commit 824eda0
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
33 changes: 33 additions & 0 deletions test/lit/merge/sourcemap.wat
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
;; 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

;; Test that sourcemap information is preserved

(module
;;@ a:1:1
(func (export "f")
;;@ a:2:1
(nop)
;;@ a:3:1
)
)
;; CHECK: (type $0 (func))

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

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

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

;; CHECK: ;;@ b:1:2
;; CHECK-NEXT: (func $0_1
;; CHECK-NEXT: ;;@ b:2:2
;; CHECK-NEXT: (nop)
;; CHECK-NEXT: ;;@ b:3:2
;; CHECK-NEXT: )
8 changes: 8 additions & 0 deletions test/lit/merge/sourcemap.wat.second
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
)
)

0 comments on commit 824eda0

Please sign in to comment.