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: --validate-asm --allow-natives-syntax | 5 // Flags: --validate-asm --allow-natives-syntax |
6 | 6 |
7 var stdlib = this; | 7 var stdlib = this; |
8 | 8 |
9 function assertValidAsm(func) { | 9 function assertValidAsm(func) { |
10 assertTrue(%IsAsmWasmCode(func)); | 10 assertTrue(%IsAsmWasmCode(func)); |
(...skipping 1657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1668 var foo = fround(1.25); | 1668 var foo = fround(1.25); |
1669 function caller() { | 1669 function caller() { |
1670 foo = fround(foo + fround(1.0)); | 1670 foo = fround(foo + fround(1.0)); |
1671 foo = fround(foo + fround(1.0)); | 1671 foo = fround(foo + fround(1.0)); |
1672 return +foo; | 1672 return +foo; |
1673 } | 1673 } |
1674 return {caller: caller}; | 1674 return {caller: caller}; |
1675 } | 1675 } |
1676 | 1676 |
1677 assertWasm(3.25, TestFloatGlobals); | 1677 assertWasm(3.25, TestFloatGlobals); |
| 1678 |
| 1679 |
| 1680 (function TestExportTwice() { |
| 1681 function asmModule() { |
| 1682 "use asm"; |
| 1683 function foo() { |
| 1684 return 42; |
| 1685 } |
| 1686 return {bar: foo, baz: foo}; |
| 1687 } |
| 1688 var m = asmModule(); |
| 1689 assertEquals(42, m.bar()); |
| 1690 assertEquals(42, m.baz()); |
| 1691 })(); |
OLD | NEW |