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

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

Issue 918653002: Propagate pseudo-constants expressions separately in tree rewriter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Comment, bugfix, and test case Created 5 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
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 // VMOptions=-DUSE_CPS_IR=true 4 // VMOptions=-DUSE_CPS_IR=true
5 5
6 // Tests for basic functionality. 6 // Tests for basic functionality.
7 7
8 library basic_tests; 8 library basic_tests;
9 9
10 import 'js_backend_cps_ir.dart'; 10 import 'js_backend_cps_ir.dart';
11 11
12 const List<TestEntry> tests = const [ 12 const List<TestEntry> tests = const [
13 const TestEntry(r""" 13 const TestEntry(r"""
14 main() { 14 main() {
15 var e = 1; 15 var e = 1;
16 var l = [1, 2, 3]; 16 var l = [1, 2, 3];
17 var m = {'s': 1}; 17 var m = {'s': 1};
18 18
19 print('(' ')'); 19 print('(' ')');
20 print('(${true})'); 20 print('(${true})');
21 print('(${1})'); 21 print('(${1})');
22 print('(${[1, 2, 3]})'); 22 print('(${[1, 2, 3]})');
23 print('(${{'s': 1}})'); 23 print('(${{'s': 1}})');
24 print('($e)'); 24 print('($e)');
25 print('($l)'); 25 print('($l)');
26 print('($m)'); 26 print('($m)');
27 }""",r""" 27 }""",r"""
28 function() { 28 function() {
29 var e, l, m; 29 var l, m;
30 e = 1;
31 l = [1, 2, 3]; 30 l = [1, 2, 3];
32 m = P.LinkedHashMap_LinkedHashMap$_literal(["s", 1]); 31 m = P.LinkedHashMap_LinkedHashMap$_literal(["s", 1]);
33 P.print("()"); 32 P.print("()");
34 P.print("(" + true + ")"); 33 P.print("(" + true + ")");
35 P.print("(" + 1 + ")"); 34 P.print("(" + 1 + ")");
36 P.print("(" + H.S([1, 2, 3]) + ")"); 35 P.print("(" + H.S([1, 2, 3]) + ")");
37 P.print("(" + H.S(P.LinkedHashMap_LinkedHashMap$_literal(["s", 1])) + ")"); 36 P.print("(" + H.S(P.LinkedHashMap_LinkedHashMap$_literal(["s", 1])) + ")");
38 P.print("(" + H.S(e) + ")"); 37 P.print("(" + 1 + ")");
39 P.print("(" + H.S(l) + ")"); 38 P.print("(" + H.S(l) + ")");
40 P.print("(" + H.S(m) + ")"); 39 P.print("(" + H.S(m) + ")");
41 return null; 40 return null;
42 }"""), 41 }"""),
43 const TestEntry(""" 42 const TestEntry("""
44 foo(a, [b = "b"]) => b; 43 foo(a, [b = "b"]) => b;
45 bar(a, {b: "b", c: "c"}) => c; 44 bar(a, {b: "b", c: "c"}) => c;
46 main() { 45 main() {
47 foo(0); 46 foo(0);
48 foo(1, 2); 47 foo(1, 2);
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 function() { 129 function() {
131 P.print(P.DateTime$now().isBefore$1(P.DateTime$now())); 130 P.print(P.DateTime$now().isBefore$1(P.DateTime$now()));
132 return null; 131 return null;
133 }"""), 132 }"""),
134 ]; 133 ];
135 134
136 135
137 void main() { 136 void main() {
138 runTests(tests); 137 runTests(tests);
139 } 138 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698