mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 00:09:49 +00:00
7a63ff2604
The block starts and ends for the entry points to the finally block instances corresponding to break paths were emitted in the same order, causing the jump targets to be reversed. Change-Id: Ifc8a6b6320ba7341140606c98333f5825d2228ac Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283042 Commit-Queue: Aske Simon Christensen <askesc@google.com> Reviewed-by: Ömer Ağacan <omersa@google.com>
34 lines
622 B
Dart
34 lines
622 B
Dart
// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
import "package:expect/expect.dart";
|
|
|
|
String test(int n) {
|
|
String s = "$n";
|
|
a:
|
|
{
|
|
b:
|
|
{
|
|
try {
|
|
if (n == 1) {
|
|
break a;
|
|
} else {
|
|
break b;
|
|
}
|
|
s += "/";
|
|
} finally {
|
|
s += "-";
|
|
}
|
|
s += "*";
|
|
}
|
|
return s + "b";
|
|
}
|
|
return s + "a";
|
|
}
|
|
|
|
main() {
|
|
Expect.equals("1-a", test(1));
|
|
Expect.equals("2-b", test(2));
|
|
}
|