diff options
author | Thomas Lively <tlively@google.com> | 2024-03-04 15:50:38 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-04 15:50:38 -0800 |
commit | 53f8d5f7bd32c8b47ee235033f3f913a8f3f2d09 (patch) | |
tree | 99644473dd8a8f2d787465c583ca19fc3c46ac1a /test | |
parent | e6cd45629860d43f9c8ab34c81c6b3b4455ec49d (diff) | |
download | binaryen-53f8d5f7bd32c8b47ee235033f3f913a8f3f2d09.tar.gz binaryen-53f8d5f7bd32c8b47ee235033f3f913a8f3f2d09.tar.bz2 binaryen-53f8d5f7bd32c8b47ee235033f3f913a8f3f2d09.zip |
[Parser] Support prologue and epilogue sourcemap annotations (#6370)
and fix a bug with sourcemap annotations on folded `if` conditions. Update
IRBuilder to apply prologue and epilogue source locations when beginning and ending
a function scope. Add basic support in the parser for explicitly tracking
annotations on module fields, although only do anything with them in the case of
prologue source location annotations.
Diffstat (limited to 'test')
-rw-r--r-- | test/lit/source-map.wast | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/test/lit/source-map.wast b/test/lit/source-map.wast index 8d22360ad..2b4d3f5c7 100644 --- a/test/lit/source-map.wast +++ b/test/lit/source-map.wast @@ -1,7 +1,10 @@ ;; RUN: wasm-opt %s -o %t.wasm -osm %t.map -g -q ;; RUN: wasm-opt %t.wasm -ism %t.map -q -o - -S | filecheck %s +;; RUN: wasm-opt %s --new-wat-parser -S -o - | filecheck %s + (module + ;;@ src.cpp:0:1 (func $foo (param $x i32) (param $y i32) ;;@ src.cpp:10:1 (if @@ -12,8 +15,11 @@ ;;@ src.cpp:40:1 (local.get $y) ) + ;; For the legacy parser ;;@ src.cpp:50:1 (then + ;; For the new parser + ;;@ src.cpp:50:1 (return) ) ) @@ -24,10 +30,12 @@ ;;@ src.cpp:80:1 (local.get $y) ) + ;;@ src.cpp:90:1 ) ) -;; CHECK: (func $foo (param $x i32) (param $y i32) +;; CHECK: ;;@ src.cpp:0:1 +;; CHECK-NEXT: (func $foo (param $x i32) (param $y i32) ;; CHECK-NEXT: ;;@ src.cpp:10:1 ;; CHECK-NEXT: (if ;; CHECK-NEXT: ;;@ src.cpp:20:1 @@ -49,3 +57,5 @@ ;; CHECK-NEXT: ;;@ src.cpp:80:1 ;; CHECK-NEXT: (local.get $y) ;; CHECK-NEXT: ) +;; CHECK-NEXT: ;;@ src.cpp:90:1 +;; CHECK-NEXT: ) |