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

Unified Diff: tests/compiler/dart2js/side_effect_tdiv_regression_test.dart

Issue 111553003: Fix regression on side effects of tdiv. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years 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/compiler/dart2js/side_effect_tdiv_regression_test.dart
===================================================================
--- tests/compiler/dart2js/side_effect_tdiv_regression_test.dart (revision 0)
+++ tests/compiler/dart2js/side_effect_tdiv_regression_test.dart (revision 0)
@@ -0,0 +1,30 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// 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.
+
+import 'package:expect/expect.dart';
+import "package:async_helper/async_helper.dart";
+
+import 'compiler_helper.dart';
+import 'parser_helper.dart';
+
+const String TEST = r'''
+class A {
+ var field = 42;
+}
+main() {
+ var a = new A();
+ var b = [42, -1];
+ // Force a setter on [field].
+ if (false) a.field = 12;
+ var c = a.field;
+ print(b[0] ~/ b[1]);
+ return c + a.field;
+}
+''';
+
+void main() {
+ asyncTest(() => compileAll(TEST).then((generated) {
+ Expect.isTrue(generated.contains('return c + c;'));
sra1 2013/12/11 09:45:24 How does adding the side effect in the mock librar
ngeoffray 2013/12/16 13:31:41 In order to get a.field GVN'ed, we need to see tha
+ }));
+}
« tests/compiler/dart2js/mock_compiler.dart ('K') | « tests/compiler/dart2js/mock_compiler.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698