diff options
author | Alon Zakai <azakai@google.com> | 2023-08-31 15:41:03 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-31 15:41:03 -0700 |
commit | 126d4fab3e00f003a06dac23f96aa70cbb75aa67 (patch) | |
tree | 21a12fe65130861c7d53b80aba93ba21c3392c27 /test/lit/debug/replace-keep.wat | |
parent | 0d3c2eeb634913643f2cade4b5d738962b2308c2 (diff) | |
download | binaryen-126d4fab3e00f003a06dac23f96aa70cbb75aa67.tar.gz binaryen-126d4fab3e00f003a06dac23f96aa70cbb75aa67.tar.bz2 binaryen-126d4fab3e00f003a06dac23f96aa70cbb75aa67.zip |
DebugInfo: Don't trample in replaceCurrent() (#5915)
Copy the old expression's debug info if the new has none. But if the new has
its own, trust that.
Followup to #5914
Diffstat (limited to 'test/lit/debug/replace-keep.wat')
-rw-r--r-- | test/lit/debug/replace-keep.wat | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/lit/debug/replace-keep.wat b/test/lit/debug/replace-keep.wat index 1418d13dd..cfd8e1ced 100644 --- a/test/lit/debug/replace-keep.wat +++ b/test/lit/debug/replace-keep.wat @@ -37,4 +37,36 @@ ) ) ) + + ;; CHECK: (func $test-no-trample + ;; CHECK-NEXT: (local $temp i32) + ;; CHECK-NEXT: [none] ;;@ src.cpp:300:3 + ;; CHECK-NEXT: [none](block + ;; CHECK-NEXT: [none] ;;@ src.cpp:400:4 + ;; CHECK-NEXT: (call $test) + ;; CHECK-NEXT: [none] ;;@ src.cpp:200:2 + ;; CHECK-NEXT: (local.set $temp + ;; CHECK-NEXT: [i32] ;;@ src.cpp:500:5 + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; end block + ;; CHECK-NEXT: ;;@ src.cpp:200:2 + ;; CHECK-NEXT: ) + (func $test-no-trample + (local $temp i32) + + ;; As above, but now the inner block has debug info (300), which should not + ;; be trampled as it is moved outside. + + ;;@ src.cpp:200:2 + (local.set $temp + ;;@ src.cpp:300:3 + (block (result i32) + ;;@ src.cpp:400:4 + (call $test) + ;;@ src.cpp:500:5 + (i32.const 1) + ) + ) + ) ) |