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

Unified Diff: tests/language/state_mangling4_test.dart

Issue 11186048: Fix bad mangling of environment parameters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update comments. Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: tests/language/state_mangling4_test.dart
diff --git a/tests/language/state_mangling_test.dart b/tests/language/state_mangling4_test.dart
similarity index 66%
copy from tests/language/state_mangling_test.dart
copy to tests/language/state_mangling4_test.dart
index 02df690ca51e966dc7f9395ebc47a5417bbbe578..b6aab91f1bd54fd3730c4aea2c5469ed443e07a0 100644
--- a/tests/language/state_mangling_test.dart
+++ b/tests/language/state_mangling4_test.dart
@@ -2,17 +2,17 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-foo(state) {
- if (state == null) return 0;
- var sum = 0;
- for (int i = 0; i < state.length; i++) {
- sum += state[i];
+foo(env1) {
+ if (env1 == null) return 0;
+ var env0 = 0;
+ for (int i = 0; i < env1.length; i++) {
+ env0 += env1[i];
}
- state = inscrutableId(state);
- for (int i = 0; i < state.length; i++) {
- sum += state[i];
+ env1 = inscrutableId(new A());
+ for (int i = 0; i < env1.length; i++) {
+ env0 += env1[i];
}
- return sum;
+ return env0;
}
int inscrutable(int x) => x == 0 ? 0 : x | inscrutable(x & (x - 1));
@@ -28,7 +28,7 @@ class A {
}
main() {
- Expect.equals(12, foo([1, 2, 3]));
+ Expect.equals(9, foo([1, 2, 3]));
if (inscrutableId(0) == 0) {
Expect.equals(6, foo(new A()));
}
« lib/compiler/implementation/ssa/codegen.dart ('K') | « tests/language/state_mangling3_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698