774c454ffa
`builder.current` at the time of creating the labelGraph is the block after the body. So setting that as the end node of the subGraph was including all the code after loop into the body of the labeled statement. Instead we use the `bodyBlock` as the end of the labelGraph as this is the last block in the body of the loop. If no such body exists, we use the `conditionEndBlock` which is the block right before the body (and still includes the logic to exit the loop). Also changes codegen to not emit a labelStatement if it has no body. AFAICT we don't do DCE on flow blocks so codegen is the best time to avoid emitting this code. Bug: https://github.com/dart-lang/sdk/issues/62185 Change-Id: Ia80cc7d3b44782c6193a67e8adbbc66f00b8f133 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/468060 Commit-Queue: Nate Biggs <natebiggs@google.com> Reviewed-by: Sigmund Cherem <sigmund@google.com>
This directory contains tests of the language and core library implementations. For more information, see https://github.com/dart-lang/sdk/tree/main/docs/Testing.md.