| 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 // Test correctness of side effects tracking used by load to load forwarding. | 4 // Test correctness of side effects tracking used by load to load forwarding. |
| 5 | 5 |
| 6 import "package:expect/expect.dart"; | |
| 7 | |
| 8 class A { | 6 class A { |
| 9 var x, y; | 7 var x, y; |
| 10 A(this.x, this.y); | 8 A(this.x, this.y); |
| 11 } | 9 } |
| 12 | 10 |
| 13 foo(a) { | 11 foo(a) { |
| 14 var value1 = a.x; | 12 var value1 = a.x; |
| 15 var value2 = a.y; | 13 var value2 = a.y; |
| 16 for (var j = 1; j < 4; j++) { | 14 for (var j = 1; j < 4; j++) { |
| 17 value1 |= a.x << (j * 8); | 15 value1 |= a.x << (j * 8); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 35 return [value1, value2]; | 33 return [value1, value2]; |
| 36 } | 34 } |
| 37 | 35 |
| 38 main() { | 36 main() { |
| 39 for (var i = 0; i < 2000; i++) { | 37 for (var i = 0; i < 2000; i++) { |
| 40 Expect.listEquals([0x02010000, 0x03020100], foo(new A(0, 0))); | 38 Expect.listEquals([0x02010000, 0x03020100], foo(new A(0, 0))); |
| 41 Expect.listEquals([0x02010000, 0x03020100], bar(new A(0, 0), false)); | 39 Expect.listEquals([0x02010000, 0x03020100], bar(new A(0, 0), false)); |
| 42 Expect.listEquals([0x04020000, 0x03020100], bar(new A(0, 0), true)); | 40 Expect.listEquals([0x04020000, 0x03020100], bar(new A(0, 0), true)); |
| 43 } | 41 } |
| 44 } | 42 } |
| OLD | NEW |