diff options
Diffstat (limited to 'test/lit/metadce')
-rw-r--r-- | test/lit/metadce/sourcemap.wat | 26 | ||||
-rw-r--r-- | test/lit/metadce/sourcemap.wat.json | 13 |
2 files changed, 39 insertions, 0 deletions
diff --git a/test/lit/metadce/sourcemap.wat b/test/lit/metadce/sourcemap.wat new file mode 100644 index 000000000..bf695fd21 --- /dev/null +++ b/test/lit/metadce/sourcemap.wat @@ -0,0 +1,26 @@ +;; 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 +;; 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 + +;; 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: ;;@ a:1:1 +;; CHECK-NEXT: (func $0 +;; CHECK-NEXT: ;;@ a:2:1 +;; CHECK-NEXT: (nop) +;; CHECK-NEXT: ;;@ a:3:1 +;; CHECK-NEXT: ) diff --git a/test/lit/metadce/sourcemap.wat.json b/test/lit/metadce/sourcemap.wat.json new file mode 100644 index 000000000..4b2028140 --- /dev/null +++ b/test/lit/metadce/sourcemap.wat.json @@ -0,0 +1,13 @@ +[ + { + "name": "root", + "reaches": [ + "f" + ], + "root": true + }, + { + "name": "f", + "export": "f" + } +] |