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 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
750 } | 750 } |
751 default: return 0; | 751 default: return 0; |
752 } | 752 } |
753 return 0; | 753 return 0; |
754 } | 754 } |
755 | 755 |
756 return {caller:caller}; | 756 return {caller:caller}; |
757 } | 757 } |
758 | 758 |
759 assertEquals(43, _WASMEXP_.asmCompileRun(TestNestedSwitch.toString())); | 759 assertEquals(43, _WASMEXP_.asmCompileRun(TestNestedSwitch.toString())); |
| 760 |
| 761 function TestInitFunctionWithNoGlobals() { |
| 762 "use asm"; |
| 763 function caller() { |
| 764 return 51; |
| 765 } |
| 766 return {caller}; |
| 767 } |
| 768 |
| 769 var module = _WASMEXP_.instantiateModuleFromAsm( |
| 770 TestInitFunctionWithNoGlobals.toString()); |
| 771 module.__init__(); |
| 772 assertEquals(51, module.caller()); |
| 773 |
| 774 function TestExportNameDifferentFromFunctionName() { |
| 775 "use asm"; |
| 776 function caller() { |
| 777 return 55; |
| 778 } |
| 779 return {alt_caller:caller}; |
| 780 } |
| 781 |
| 782 var module = _WASMEXP_.instantiateModuleFromAsm( |
| 783 TestExportNameDifferentFromFunctionName.toString()); |
| 784 module.__init__(); |
| 785 assertEquals(55, module.alt_caller()); |
OLD | NEW |