OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 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 | 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 // Regression test for dart2js that used to crash during the | 5 // Regression test for dart2js that used to crash during the |
6 // [SsaCodeMotion] phase on this code. | 6 // [SsaCodeMotion] phase on this code. |
7 | 7 |
8 class A { | 8 class A { |
9 final finalField; | 9 final finalField; |
10 var field = 2; | 10 var field = 2; |
(...skipping 24 matching lines...) Expand all Loading... |
35 // the call to [bar]. | 35 // the call to [bar]. |
36 var c = a.finalField; | 36 var c = a.finalField; |
37 c.foo(); | 37 c.foo(); |
38 | 38 |
39 // [e] does not get GVN'ed because the GVN phase sees [c.foo()] as | 39 // [e] does not get GVN'ed because the GVN phase sees [c.foo()] as |
40 // having side effects. | 40 // having side effects. |
41 var e = a.field; | 41 var e = a.field; |
42 if (d + e != 4) throw 'Test failed'; | 42 if (d + e != 4) throw 'Test failed'; |
43 } | 43 } |
44 } | 44 } |
OLD | NEW |