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

Side by Side Diff: frog/tests/leg/src/SsaPhiEliminatorTest.dart

Issue 9035008: Do not generate at use site loop phis. It requires live analysis that we currently don't implement. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 12 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 | « frog/leg/ssa/phi_eliminator.dart ('k') | frog/tests/leg/src/TypeInferenceTest.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 that parameters keep their names in the output. 4 // Test that parameters keep their names in the output.
5 5
6 #import("compiler_helper.dart"); 6 #import("compiler_helper.dart");
7 7
8 final String TEST_ONE = @""" 8 final String TEST_ONE = @"""
9 void foo(bar) { 9 void foo(bar) {
10 var a = 1; 10 var a = 1;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 if (i == 9) cond1 = false; 47 if (i == 9) cond1 = false;
48 for (var j = 0; cond2; j = j + 1) { 48 for (var j = 0; cond2; j = j + 1) {
49 if (j == 9) cond2 = false; 49 if (j == 9) cond2 = false;
50 } 50 }
51 } 51 }
52 print(cond1); 52 print(cond1);
53 print(cond2); 53 print(cond2);
54 } 54 }
55 """; 55 """;
56 56
57 String anyIdentifier = "[a-zA-Z][a-zA-Z0-9]*";
58
57 main() { 59 main() {
58 String generated = compile(TEST_ONE, 'foo'); 60 String generated = compile(TEST_ONE, 'foo');
59 RegExp regexp = const RegExp("a = 2"); 61 RegExp regexp = const RegExp("a = 2");
60 Expect.isTrue(regexp.hasMatch(generated)); 62 Expect.isTrue(regexp.hasMatch(generated));
61 63
62 regexp = const RegExp("a = 3"); 64 regexp = const RegExp("a = 3");
63 Expect.isTrue(regexp.hasMatch(generated)); 65 Expect.isTrue(regexp.hasMatch(generated));
64 66
65 regexp = const RegExp("print\\(a\\)"); 67 regexp = const RegExp("print\\(a\\)");
66 Expect.isTrue(regexp.hasMatch(generated)); 68 Expect.isTrue(regexp.hasMatch(generated));
67 69
68 generated = compile(TEST_TWO, 'main'); 70 generated = compile(TEST_TWO, 'main');
69 regexp = const RegExp("t = \\(t +"); 71 regexp = new RegExp("t = \\($anyIdentifier +");
70 Expect.isTrue(regexp.hasMatch(generated)); 72 Expect.isTrue(regexp.hasMatch(generated));
71 73
72 regexp = const RegExp("i = \\(i +"); 74 regexp = new RegExp("i = \\($anyIdentifier +");
73 Expect.isTrue(regexp.hasMatch(generated));
74
75 regexp = const RegExp("print\\(t\\)");
76 Expect.isTrue(regexp.hasMatch(generated)); 75 Expect.isTrue(regexp.hasMatch(generated));
77 76
78 generated = compile(TEST_THREE, 'foo'); 77 generated = compile(TEST_THREE, 'foo');
79 78
80 // Check that we don't have 'val = val'. 79 // Check that we don't have 'val = val'.
81 regexp = const RegExp("val = val;"); 80 regexp = const RegExp("val = val;");
82 Expect.isTrue(!regexp.hasMatch(generated)); 81 Expect.isTrue(!regexp.hasMatch(generated));
83 82
84 regexp = const RegExp("return val"); 83 regexp = const RegExp("return val");
85 Expect.isTrue(regexp.hasMatch(generated)); 84 Expect.isTrue(regexp.hasMatch(generated));
86 // Check that a store just after the declaration of the local 85 // Check that a store just after the declaration of the local
87 // only generates one instruction. 86 // only generates one instruction.
88 regexp = const RegExp("var val = 42"); 87 regexp = const RegExp("var val = 42");
89 Expect.isTrue(regexp.hasMatch(generated)); 88 Expect.isTrue(regexp.hasMatch(generated));
90 89
91 generated = compile(TEST_FOUR, 'foo'); 90 generated = compile(TEST_FOUR, 'foo');
92 91
93 regexp = const RegExp("cond1 = cond1;"); 92 regexp = const RegExp("cond1 = cond1;");
94 Expect.isTrue(!regexp.hasMatch(generated)); 93 Expect.isTrue(!regexp.hasMatch(generated));
95 94
96 regexp = const RegExp("cond2 = cond2;"); 95 regexp = const RegExp("cond2 = cond2;");
97 Expect.isTrue(!regexp.hasMatch(generated)); 96 Expect.isTrue(!regexp.hasMatch(generated));
98 } 97 }
OLDNEW
« no previous file with comments | « frog/leg/ssa/phi_eliminator.dart ('k') | frog/tests/leg/src/TypeInferenceTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698