| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2016, 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 // VMOptions=--optimization_counter_threshold=10 --no-background_compilation |
| 5 |
| 6 import 'dart:typed_data'; |
| 7 import 'package:expect/expect.dart'; |
| 8 |
| 9 unalignedFloat32() { |
| 10 var bytes = new ByteData(64); |
| 11 for (var i = 0; i < 4; i++) { |
| 12 bytes.setFloat32(i, 16.25); |
| 13 Expect.equals(16.25, bytes.getFloat32(i)); |
| 14 } |
| 15 } |
| 16 |
| 17 unalignedFloat64() { |
| 18 var bytes = new ByteData(64); |
| 19 for (var i = 0; i < 8; i++) { |
| 20 bytes.setFloat64(i, 16.25); |
| 21 Expect.equals(16.25, bytes.getFloat64(i)); |
| 22 } |
| 23 } |
| 24 |
| 25 main() { |
| 26 for (var i = 0; i < 20; i++) { |
| 27 unalignedFloat32(); |
| 28 unalignedFloat64(); |
| 29 } |
| 30 } |
| OLD | NEW |