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 correct usage of inlined double temporary objects. | 4 // Test correct usage of inlined double temporary objects. |
5 | 5 |
6 main() { | 6 main() { |
7 for (int i = 0; i < 2000; i++) { | 7 for (int i = 0; i < 2000; i++) { |
8 testBinaryOp(); | 8 testBinaryOp(); |
9 testUnaryOp(); | 9 testUnaryOp(); |
10 } | 10 } |
(...skipping 18 matching lines...) Expand all Loading... |
29 double unary(double a, double b) { | 29 double unary(double a, double b) { |
30 return -(a * (-b)); | 30 return -(a * (-b)); |
31 } | 31 } |
32 | 32 |
33 | 33 |
34 testUnaryOp() { | 34 testUnaryOp() { |
35 var x = unary(1.0, 2.0); | 35 var x = unary(1.0, 2.0); |
36 var y = unary(3.0, 4.0); | 36 var y = unary(3.0, 4.0); |
37 Expect.equals(2.0, x); | 37 Expect.equals(2.0, x); |
38 } | 38 } |
OLD | NEW |