Files
sdk/tests/language_2/vm/regress_31946_test.dart
T
Martin Kustermann 11006c3bac Reland "[VM] Use IR for code in [CatchEntryInstr]s to populate captured exception/stacktrace variables"
This fixes an issue when a program got loaded via dill, a function
with a try-catch got optimized and the exception/stacktrace variables
got captured.

Change-Id: Icb8ea5f3557080f8274f7db2af09e33154820e5b
Reviewed-on: https://dart-review.googlesource.com/55721
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-05-17 16:48:56 +00:00

33 lines
765 B
Dart

// Copyright (c) 2018, 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.
// VMOptions=--no_background_compilation --optimization_counter_threshold=10
import 'dart:async';
import 'package:expect/expect.dart';
var root = [];
var tests = <dynamic>[
() async {},
() async {
await new Future.value();
root.singleWhere((f) => f.name == 'optimizedFunction');
},
];
main(args) async {
for (int i = 0; i < 100; ++i) {
int exceptions = 0;
for (final test in tests) {
try {
await test();
} on StateError {
exceptions++;
}
}
Expect.isTrue(exceptions == 1);
}
}