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

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

Issue 188433002: Instruction selection before removing HTypeKnown (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/tracer.dart ('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
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4 // Test constant folding on numbers.
5
6 import "package:expect/expect.dart";
7 import 'compiler_helper.dart';
8
9 const String CODE = """
10 class A {
11 var link;
12 }
13 int foo(x) {
14 if (new DateTime.now().millisecondsSinceEpoch == 42) return null;
15 var a = new A();
16 if (new DateTime.now().millisecondsSinceEpoch == 42) return a;
17 a.link = a;
18 return a;
19 }
20 void main() {
21 var x = foo(0);
22 return x == x.link;
23 }
24 """;
25
26 main() {
27 // The `==` is strengthened to a HIdentity instruction. The HIdentity follows
28 // `x.link`, so x cannot be `null`.
29 var compare = new RegExp(r'x === x\.get\$link\(\)');
30 compileAndMatch(CODE, 'main', compare);
31 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/tracer.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698