-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix functionTypes indexes of imported functions (#240)
- Loading branch information
1 parent
0e52356
commit 75c55b4
Showing
5 changed files
with
89 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
(module | ||
(type (;0;) (func (param i32) (result f64))) | ||
(type (;1;) (func (param f64) (result f64))) | ||
(type (;2;) (func (param i32 f64))) | ||
(type (;3;) (func (param f64 f64) (result f64))) | ||
(type (;4;) (func)) | ||
|
||
(import "env" "memory" (memory 1)) | ||
(import "env" "cbrt" (func $cbrt (type 0))) | ||
(import "env" "log" (func $log (type 2))) | ||
|
||
(func $pow2 (type 1) (param f64) (result f64) | ||
local.get 0 | ||
local.get 0 | ||
f64.mul | ||
) | ||
(func $add (type 3) (param f64 f64) (result f64) | ||
local.get 0 | ||
local.get 1 | ||
f64.add | ||
) | ||
(func $main (type 4) | ||
i32.const 1 | ||
i32.const 512 | ||
call $cbrt | ||
call $pow2 | ||
f64.const 100.0 | ||
call $add | ||
call $log | ||
) | ||
|
||
(export "pow2" (func $pow2)) | ||
(export "main" (func $main)) | ||
) | ||
|