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

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

Issue 1759973002: Add --no-background-compilation to tests that expect to run code in optimized form (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: more Created 4 years, 9 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 // VMOptions=--optimization-counter-threshold=10 --no-use-osr 4 // VMOptions=--optimization-counter-threshold=10 --no-use-osr --no-background-co mpilation
5 5
6 import "package:expect/expect.dart"; 6 import "package:expect/expect.dart";
7 7
8 // Test optimization of redundant array loads. 8 // Test optimization of redundant array loads.
9 9
10 var A = [0,2,3]; 10 var A = [0,2,3];
11 11
12 test1(a) { 12 test1(a) {
13 int x = a[0]; 13 int x = a[0];
14 int y = a[1]; 14 int y = a[1];
15 ++a[0]; 15 ++a[0];
16 return a[0] + y + a[2]; 16 return a[0] + y + a[2];
17 } 17 }
18 18
19 19
20 int test2(a) { 20 int test2(a) {
21 return a[2] + a[2]; 21 return a[2] + a[2];
22 } 22 }
23 23
24 24
25 main() { 25 main() {
26 for (int i = 0; i < 20; i++) { 26 for (int i = 0; i < 20; i++) {
27 test1(A); 27 test1(A);
28 test2(A); 28 test2(A);
29 } 29 }
30 Expect.equals(26, test1(A)); 30 Expect.equals(26, test1(A));
31 Expect.equals(6, test2(A)); 31 Expect.equals(6, test2(A));
32 } 32 }
OLDNEW
« no previous file with comments | « tests/language/number_identity_test.dart ('k') | tests/language/optimized_constant_array_string_access_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698