Chromium Code Reviews| 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); |
| +} |