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

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

Issue 968843003: Implement type argument access and reification of runtime types. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: tests/compiler/dart2js/js_backend_cps_ir_runtime_types_test.dart
diff --git a/tests/compiler/dart2js/js_backend_cps_ir_runtime_types_test.dart b/tests/compiler/dart2js/js_backend_cps_ir_runtime_types_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..d1e311b9c1a7a3aa005b04b83b22e7781c135c8d
--- /dev/null
+++ b/tests/compiler/dart2js/js_backend_cps_ir_runtime_types_test.dart
@@ -0,0 +1,37 @@
+// 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.
+// VMOptions=-DUSE_CPS_IR=true
+
+// Tests for the runtime type implementation.
+
+library basic_tests;
+
+import 'js_backend_cps_ir.dart';
+
+const String getTypeArgument = r'H.getTypeArgumentByIndex';
+const String typeToString = r'H.runtimeTypeToString';
+const String createType = r'H.createRuntimeType';
+
+const List<TestEntry> tests = const [
+ const TestEntry.forMethod("function(C#foo)",
+r"""
+class C<T> {
+ foo() { print(T); }
+}
+
+main() {
+ new C<int>().foo();
+}""",
+"""
+function() {
+ var v0, v1;
+ v1 = $getTypeArgument(v0, 0);
asgerf 2015/03/02 13:52:37 This output is clearly wrong since v0 is uninitial
karlklose 2015/03/05 09:54:58 Acknowledged.
+ P.print($createType($typeToString(v1)));
+ return null;
+}"""),
+];
+
+void main() {
+ runTests(tests);
+}

Powered by Google App Engine
This is Rietveld 408576698