OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 import "package:expect/expect.dart"; | |
6 | |
7 foo(t0) { | 5 foo(t0) { |
8 var a = t0, b = baz(), c = bar(); | 6 var a = t0, b = baz(), c = bar(); |
9 if (t0 == 'foo') { | 7 if (t0 == 'foo') { |
10 // Force a SSA swapping problem where dart2js used to use 't0' as | 8 // Force a SSA swapping problem where dart2js used to use 't0' as |
11 // a temporary variable. | 9 // a temporary variable. |
12 var tmp = c; | 10 var tmp = c; |
13 c = b; | 11 c = b; |
14 b = tmp; | 12 b = tmp; |
15 } | 13 } |
16 | 14 |
17 Expect.equals('foo', a); | 15 Expect.equals('foo', a); |
18 Expect.equals('foo', t0); | 16 Expect.equals('foo', t0); |
19 Expect.equals('bar', b); | 17 Expect.equals('bar', b); |
20 Expect.equals('baz', c); | 18 Expect.equals('baz', c); |
21 } | 19 } |
22 | 20 |
23 bar() => 'bar'; | 21 bar() => 'bar'; |
24 baz() => 'baz'; | 22 baz() => 'baz'; |
25 | 23 |
26 main() { | 24 main() { |
27 foo('foo'); | 25 foo('foo'); |
28 } | 26 } |
OLD | NEW |