diff options
author | Jérôme Vouillon <jerome.vouillon@gmail.com> | 2024-05-14 16:01:01 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-14 13:01:01 -0700 |
commit | 140386ed24ece9f30b2ad7dc55f63716f7a61f5e (patch) | |
tree | bebd167535305fbeaad79779e25ecc73b233c502 /test | |
parent | 55f33b55daa965672d2b8aca98ce1570e3fb52c0 (diff) | |
download | binaryen-140386ed24ece9f30b2ad7dc55f63716f7a61f5e.tar.gz binaryen-140386ed24ece9f30b2ad7dc55f63716f7a61f5e.tar.bz2 binaryen-140386ed24ece9f30b2ad7dc55f63716f7a61f5e.zip |
Source maps: Allow specifying that an expression has no debug info in text (#6520)
;;@
with nothing else (no source:line) can be used to specify that the following
expression does not have any debug info associated to it. This can be used
to stop the automatic propagation of debug info in the text parsers.
The text printer has also been updated to output this comment when needed.
Diffstat (limited to 'test')
-rw-r--r-- | test/example/debug-location-propagation.cpp | 8 | ||||
-rw-r--r-- | test/lit/debug/source-map-stop.wast | 37 |
2 files changed, 41 insertions, 4 deletions
diff --git a/test/example/debug-location-propagation.cpp b/test/example/debug-location-propagation.cpp index b4685e391..06bf8ab48 100644 --- a/test/example/debug-location-propagation.cpp +++ b/test/example/debug-location-propagation.cpp @@ -33,10 +33,10 @@ int main() { auto& debugLocations = module->getFunction("adder")->debugLocations; assert(debugLocations.size() == 4); - assert(debugLocations[x].columnNumber == 13); - assert(debugLocations[y].columnNumber == 13); - assert(debugLocations[add].columnNumber == 2); - assert(debugLocations[drop].columnNumber == 2); + assert(debugLocations[x]->columnNumber == 13); + assert(debugLocations[y]->columnNumber == 13); + assert(debugLocations[add]->columnNumber == 2); + assert(debugLocations[drop]->columnNumber == 2); BinaryenSetDebugInfo(false); BinaryenModuleDispose(module); diff --git a/test/lit/debug/source-map-stop.wast b/test/lit/debug/source-map-stop.wast index cdc06505e..95545e65a 100644 --- a/test/lit/debug/source-map-stop.wast +++ b/test/lit/debug/source-map-stop.wast @@ -124,4 +124,41 @@ ;;@ waka:200:2 (i32.const 2) ) + + ;; CHECK: (func $foo (param $x i32) (param $y i32) + ;; CHECK-NEXT: ;;@ src.cpp:90:1 + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: ;;@ + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: (local.get $y) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: ;;@ src.cpp:100:1 + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: ;;@ + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + (func $foo (param $x i32) (param $y i32) + ;;@ src.cpp:90:1 + (if + ;;@ + (i32.add + (local.get $x) + (local.get $y) + ) + (then + ;;@ src.cpp:100:1 + (return) + ) + (else + ;;@ + (return) + ) + ) + ) ) |