| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Flags: --expose-wasm |
| 6 |
| 5 load("test/mjsunit/wasm/wasm-constants.js"); | 7 load("test/mjsunit/wasm/wasm-constants.js"); |
| 6 | 8 |
| 7 var module = (function () { | 9 var module = (function () { |
| 8 var kBodySize = 5; | 10 var kBodySize = 5; |
| 9 var kNameOffset = 21 + kBodySize + 1; | 11 var kNameOffset = 21 + kBodySize + 1; |
| 10 | 12 |
| 11 return WASM.instantiateModule(bytes( | 13 return WASM.instantiateModule(bytes( |
| 12 // -- memory | 14 // -- memory |
| 13 kDeclMemory, | 15 kDeclMemory, |
| 14 12, 12, 1, | 16 12, 12, 1, |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 'f', 'l', 't', 0 // name | 136 'f', 'l', 't', 0 // name |
| 135 ); | 137 ); |
| 136 | 138 |
| 137 var module = WASM.instantiateModule(data); | 139 var module = WASM.instantiateModule(data); |
| 138 | 140 |
| 139 assertEquals("function", typeof module.flt); | 141 assertEquals("function", typeof module.flt); |
| 140 assertEquals(1, module.flt(-2, -1)); | 142 assertEquals(1, module.flt(-2, -1)); |
| 141 assertEquals(0, module.flt(7.3, 7.1)); | 143 assertEquals(0, module.flt(7.3, 7.1)); |
| 142 assertEquals(1, module.flt(7.1, 7.3)); | 144 assertEquals(1, module.flt(7.1, 7.3)); |
| 143 })(); | 145 })(); |
| OLD | NEW |