summaryrefslogtreecommitdiff
path: root/test/lit/passes/avoid-reinterprets.wast
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2022-08-22 13:53:47 -0700
committerGitHub <noreply@github.com>2022-08-22 13:53:47 -0700
commit38c084ee386e257389d44c6200a403f74432e1af (patch)
tree8e41abd3ad903b9fcb426bf0c4be3dd66a092247 /test/lit/passes/avoid-reinterprets.wast
parentb24df4d0c4705027fdc6e261aa3f8e4f61dc5c0a (diff)
downloadbinaryen-38c084ee386e257389d44c6200a403f74432e1af.tar.gz
binaryen-38c084ee386e257389d44c6200a403f74432e1af.tar.bz2
binaryen-38c084ee386e257389d44c6200a403f74432e1af.zip
Avoid adding new unneeded names to blocks in text roundtripping (#4943)
Previously the wat parser would turn this input: (block (nop) ) into something like this: (block $block17 (nop) ) It just added a name all the time, in case the block is referred to by an index later even though it doesn't have a name. This PR makes us rountrip more precisely by not adding such names: if there was no name before, and there is no break by index, then do not add a name. In addition, this will be useful for non-nullable locals since whether a block has a name or not matters there. Like #4912, this makes us more regular in our usage of block names.
Diffstat (limited to 'test/lit/passes/avoid-reinterprets.wast')
-rw-r--r--test/lit/passes/avoid-reinterprets.wast6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/lit/passes/avoid-reinterprets.wast b/test/lit/passes/avoid-reinterprets.wast
index 584016c97..046812dce 100644
--- a/test/lit/passes/avoid-reinterprets.wast
+++ b/test/lit/passes/avoid-reinterprets.wast
@@ -230,7 +230,7 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (f32.reinterpret_i32
- ;; CHECK-NEXT: (block $block (result i32)
+ ;; CHECK-NEXT: (block $a-name-avoids-fallthrough (result i32)
;; CHECK-NEXT: (nop)
;; CHECK-NEXT: (local.get $x)
;; CHECK-NEXT: )
@@ -246,9 +246,11 @@
)
(drop
(f32.reinterpret_i32
- (block (result i32)
+ (block $a-name-avoids-fallthrough (result i32)
(nop) ;; this would be removed by other opts, but in general, we can't
;; just look at the fallthrough, as we can't just remove code here
+ ;; (note that we need a name on the block, or else we would look at
+ ;; the fallthrough)
(local.get $x)
)
)