OLD | NEW |
---|---|
(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 import "package:expect/expect.dart"; | |
6 | |
7 var a = 42; | |
8 | |
9 inlineMe() { | |
10 // Add control flow to confuse the compiler. | |
11 if (a is int) { | |
12 print('a is int'); | |
13 } | |
14 return a[0]; | |
15 } | |
16 | |
17 main() { | |
18 a = [42]; | |
19 // Make [main] recursive to force a bailout version. | |
20 if (false) main(); | |
21 int i = 0; | |
22 for (i = inlineMe(); i < 42; i++); | |
23 Expect.equals(42, i); | |
24 } | |
OLD | NEW |