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 | 5 // Flags: --expose-wasm |
6 | 6 |
7 function EmptyTest() { | 7 function EmptyTest() { |
8 "use asm"; | 8 "use asm"; |
9 function caller() { | 9 function caller() { |
10 empty(); | 10 empty(); |
(...skipping 1247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1258 return +(a, b); | 1258 return +(a, b); |
1259 } | 1259 } |
1260 | 1260 |
1261 return {ifunc: ifunc, dfunc: dfunc}; | 1261 return {ifunc: ifunc, dfunc: dfunc}; |
1262 } | 1262 } |
1263 | 1263 |
1264 var m = _WASMEXP_.instantiateModuleFromAsm(CommaModule.toString()); | 1264 var m = _WASMEXP_.instantiateModuleFromAsm(CommaModule.toString()); |
1265 assertEquals(123, m.ifunc(456.7, 123)); | 1265 assertEquals(123, m.ifunc(456.7, 123)); |
1266 assertEquals(123.4, m.dfunc(456, 123.4)); | 1266 assertEquals(123.4, m.dfunc(456, 123.4)); |
1267 })(); | 1267 })(); |
| 1268 |
| 1269 |
| 1270 (function TestOr() { |
| 1271 function Module() { |
| 1272 "use asm"; |
| 1273 function func() { |
| 1274 var x = 1; |
| 1275 var y = 2; |
| 1276 return (x | y) | 0; |
| 1277 } |
| 1278 return {func: func}; |
| 1279 } |
| 1280 |
| 1281 var m = _WASMEXP_.instantiateModuleFromAsm(Module.toString()); |
| 1282 assertEquals(3, m.func()); |
| 1283 })(); |
| 1284 |
| 1285 |
| 1286 (function TestAnd() { |
| 1287 function Module() { |
| 1288 "use asm"; |
| 1289 function func() { |
| 1290 var x = 3; |
| 1291 var y = 2; |
| 1292 return (x & y) | 0; |
| 1293 } |
| 1294 return {func: func}; |
| 1295 } |
| 1296 |
| 1297 var m = _WASMEXP_.instantiateModuleFromAsm(Module.toString()); |
| 1298 assertEquals(2, m.func()); |
| 1299 })(); |
| 1300 |
| 1301 |
| 1302 (function TestXor() { |
| 1303 function Module() { |
| 1304 "use asm"; |
| 1305 function func() { |
| 1306 var x = 3; |
| 1307 var y = 2; |
| 1308 return (x ^ y) | 0; |
| 1309 } |
| 1310 return {func: func}; |
| 1311 } |
| 1312 |
| 1313 var m = _WASMEXP_.instantiateModuleFromAsm(Module.toString()); |
| 1314 assertEquals(1, m.func()); |
| 1315 })(); |
OLD | NEW |