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

Side by Side Diff: tests/compiler/dart2js_extra/17094_test.dart

Issue 179223002: Regression test for incorrect summary of function with interpolation (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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 | « no previous file | tests/compiler/dart2js_extra/dart2js_extra.status » ('j') | 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) 2013, 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
5 import "package:expect/expect.dart";
6
7 // Interpolation effect analysis test.
8
9 get never => new DateTime.now().millisecondsSinceEpoch == 0;
10
11 class A {
12 int a = 0;
13 toString() { ++a; return 'A'; }
14 }
15
16 // Many interpolations to make function too big to inline.
17 // Summary for [fmt] must include effects from toString().
18 fmt(x) => '$x$x$x$x$x$x$x$x$x$x$x$x$x$x$x$x$x$x$x$x$x$x$x$x$x$x$x$x$x$x';
19
20 test(a) {
21 if (a == null) return;
22 if (never) a.a += 1;
23 var b = a.a; // field load
24 var c = fmt(a); // field modified through implicit call to toString()
25 var d = a.a; // field re-load
26 Expect.equals('A 0 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 30', '$a $b $c $d');
27
28 // Extra use of [fmt] to prevent inlining on basis of single reference.
29 Expect.equals('', fmt(''));
30 }
31
32 main() {
33 test(null);
34 test(new A());
35 }
OLDNEW
« no previous file with comments | « no previous file | tests/compiler/dart2js_extra/dart2js_extra.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698