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

Side by Side Diff: tests/compiler/dart2js_extra/ir_representation_test.dart

Issue 108333007: tests for inlining between IR and AST functions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fix comments 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 // The multitest framework does not support import paths that contain '..',
6 // therefore it's not used in this file.
7 import '../dart2js_native/compiler_test_internals.dart';
8
9 /**
10 * This test verifies that the @IrRepresentation annotation works as expected.
11 * It might fail when extending the IR to express more of Dart.
12 */
13
14 // closure
15 @IrRepresentation(true)
16 test1() {
17 var f = () => 42;
18 return 1;
19 }
20
21 // parameter
22 @IrRepresentation(true)
23 test2(x) {
24 return x;
25 }
26
27 // dynamic invocation, construction
28 @IrRepresentation(true)
29 test3() {
30 new Object().hashCode;
31 }
32
33 // exceptions
34 @IrRepresentation(true)
35 test4() {
36 try {
37 throw "possum";
38 } catch (e) {
39 return e;
40 }
41 }
42
43 // control flow, loops
44 @IrRepresentation(true)
45 test5(x) {
46 while (x < 100) {
47 x += x;
48 }
49 if (x % 2 == 0) {
50 return 1;
51 } else {
52 return 2;
53 }
54 }
55
56 main() {
57 print(test1());
58 print(test2(1));
59 print(test3());
60 print(test4());
61 print(test5(2));
62 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js_extra/dart2js_extra.status ('k') | tests/compiler/dart2js_extra/ssa_inlining_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698