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

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

Issue 707493003: dart2js: Trust type annotations more often with --trust-type-annotation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase and improvements. Created 6 years, 1 month 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/trust_type_annotations2_test.dart
diff --git a/tests/compiler/dart2js/trust_type_annotations2_test.dart b/tests/compiler/dart2js/trust_type_annotations2_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..8ec4040753c325de039ff1bc9bfd726794357b9f
--- /dev/null
+++ b/tests/compiler/dart2js/trust_type_annotations2_test.dart
@@ -0,0 +1,32 @@
+// Copyright (c) 2014, 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';
+
+const String TEST = """
+
+foo(int x, int y) {
+ return x + y;
+}
+
+main (x, y) {
+ if (x != null) {
+ if (y != null) {
+ return foo(x, y);
+ }
+ }
+}
+""";
+
+main() {
+ Uri uri = new Uri(scheme: 'source');
+ var compiler = compilerFor(TEST, uri, disableInlining: false/*, trustTypeAnnotations: true*/);
floitsch 2014/11/06 16:57:52 I know, long line. I will update the test. At the
+ asyncTest(() => compiler.runCompiler(uri).then((_) {
+ var element = compiler.mainApp.findExported('main');
+ var code = compiler.backend.assembleCode(element);
+ Expect.isTrue(code.contains('+'));
+ }));
+}
« pkg/compiler/lib/src/ssa/codegen.dart ('K') | « tests/compiler/dart2js/mock_libraries.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698