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

Side by Side Diff: tests/compiler/dart2js/strength_eq_test.dart

Issue 326913002: Make dart2js unittests async. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 // Test constant folding on numbers. 4 // Test constant folding on numbers.
5 5
6 import "package:expect/expect.dart"; 6 import 'package:async_helper/async_helper.dart';
7 import 'compiler_helper.dart'; 7 import 'compiler_helper.dart';
8 8
9 const String CODE = """ 9 const String CODE = """
10 class A { 10 class A {
11 var link; 11 var link;
12 } 12 }
13 int foo(x) { 13 int foo(x) {
14 if (new DateTime.now().millisecondsSinceEpoch == 42) return null; 14 if (new DateTime.now().millisecondsSinceEpoch == 42) return null;
15 var a = new A(); 15 var a = new A();
16 if (new DateTime.now().millisecondsSinceEpoch == 42) return a; 16 if (new DateTime.now().millisecondsSinceEpoch == 42) return a;
17 a.link = a; 17 a.link = a;
18 return a; 18 return a;
19 } 19 }
20 void main() { 20 void main() {
21 var x = foo(0); 21 var x = foo(0);
22 return x == x.link; 22 return x == x.link;
23 } 23 }
24 """; 24 """;
25 25
26 main() { 26 main() {
27 // The `==` is strengthened to a HIdentity instruction. The HIdentity follows 27 // The `==` is strengthened to a HIdentity instruction. The HIdentity follows
28 // `x.link`, so x cannot be `null`. 28 // `x.link`, so x cannot be `null`.
29 var compare = new RegExp(r'x === x\.get\$link\(\)'); 29 var compare = new RegExp(r'x === x\.get\$link\(\)');
30 compileAndMatch(CODE, 'main', compare); 30 asyncTest(() => compileAndMatch(CODE, 'main', compare));
31 } 31 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/ssa_phi_codegen_test.dart ('k') | tests/compiler/dart2js/string_escapes_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698