Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: tests/language/nullaware_opt_test.dart

Issue 1211593004: Fix (optimizer) crashes in conditional nodes when result is not needed. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: z Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 // 4 //
5 // SharedOptions=--enable-null-aware-operators 5 // SharedOptions=--enable-null-aware-operators
6 // VMOptions=--optimization_counter_threshold=5 6 // VMOptions=--optimization_counter_threshold=5
7 // 7 //
8 // Basic null-aware operator test that invokes the optimizing compiler. 8 // Basic null-aware operator test that invokes the optimizing compiler.
9 9
10 import "package:expect/expect.dart"; 10 import "package:expect/expect.dart";
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 c?.f ??= 400; 51 c?.f ??= 400;
52 Expect.equals(null, c?.f); 52 Expect.equals(null, c?.f);
53 Expect.equals(null, c?.f++); 53 Expect.equals(null, c?.f++);
54 e?.f++; 54 e?.f++;
55 Expect.equals(201, e.f); 55 Expect.equals(201, e.f);
56 56
57 var x = 5 ?? bomb(); 57 var x = 5 ?? bomb();
58 } 58 }
59 59
60 // Check that instructions without result do not crash.
61 test2() {
62 var c;
63 c?.v;
64 c?.m(bomb());
65 }
66
60 main() { 67 main() {
61 for (int i = 0; i < 10; i++) { 68 for (int i = 0; i < 10; i++) {
62 test(); 69 test();
70 test2();
63 } 71 }
64 } 72 }
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698