File: sourcemap.wat

package info (click to toggle)
binaryen 120-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 41,284 kB
  • sloc: cpp: 189,449; javascript: 62,189; ansic: 14,087; python: 5,379; pascal: 441; sh: 77; makefile: 30; asm: 27
file content (34 lines) | stat: -rw-r--r-- 990 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
;; 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 --check-prefix=BIN

;; Test that sourcemap information is preserved

(module
  ;;@ a:1:2
  ;; TXT:      (type $0 (func))

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

  ;; TXT:      (func $f
  ;; TXT-NEXT:  ;;@ a:7:8:someSymbol
  ;; TXT-NEXT:  (nop)
  ;; TXT-NEXT:  ;;@ a:9:10
  ;; TXT-NEXT: )
  (func $f (export "f")
     ;;@ a:7:8:someSymbol
     (nop)
     ;;@ a:9:10
  )
)
;; BIN:      (type $0 (func))

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

;; BIN:      (func $0
;; BIN-NEXT:  ;;@ a:7:8:someSymbol
;; BIN-NEXT:  (nop)
;; BIN-NEXT:  ;;@ a:9:10
;; BIN-NEXT: )