-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
157 additions
and
41 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
(module definition binary | ||
"\00\61\73\6d\01\00\00\00\01\8e\80\80\80\00\04\60" | ||
"\00\01\7f\5d\00\60\01\7f\01\7f\5d\02\03\83\80\80" | ||
"\80\00\02\02\02\07\88\80\80\80\00\01\04\6d\61\69" | ||
"\6e\00\01\09\85\80\80\80\00\01\03\00\01\00\0a\a0" | ||
"\80\80\80\00\02\87\80\80\80\00\00\20\00\41\2c\6a" | ||
"\0b\8e\80\80\80\00\00\20\00\d2\00\e0\03\e1\03\01" | ||
"\e3\01\00\0b" | ||
) | ||
(module instance) | ||
(assert_return (invoke "main" (i32.const 0x16)) (i32.const 0x42)) | ||
(assert_return (invoke "main" (i32.const 0xffff_fe44)) (i32.const 0xffff_fe70)) |
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,21 @@ | ||
(module | ||
(type $f1 (func (result i32))) | ||
(type $c1 (cont $f1)) | ||
|
||
(type $f2 (func (param i32) (result i32))) | ||
(type $c2 (cont $f2)) | ||
|
||
(func $add44 (param i32) (result i32) (i32.add (local.get 0) (i32.const 44))) | ||
(elem declare func $add44) | ||
|
||
(func (export "main") (param i32) (result i32) | ||
(resume $c1 | ||
(cont.bind $c2 $c1 | ||
(local.get 0) | ||
(cont.new $c2 (ref.func $add44)))) | ||
) | ||
) | ||
|
||
(assert_return (invoke "main" (i32.const 22)) (i32.const 66)) | ||
(assert_return (invoke "main" (i32.const -444)) (i32.const -400)) | ||
|
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,31 @@ | ||
(module | ||
(type (;0;) (func (param i32) (result i32))) | ||
(type (;1;) (cont 0)) | ||
(type (;2;) (func (param i32 i32) (result i32))) | ||
(type (;3;) (cont 2)) | ||
(type (;4;) (func (param i32))) | ||
(type (;5;) (func)) | ||
(import "spectest" "print_i32" (func (;0;) (type 4))) | ||
(export "main" (func 3)) | ||
(start 3) | ||
(elem (;0;) declare func 1) | ||
(func (;1;) (type 2) (param i32 i32) (result i32) | ||
local.get 0 | ||
local.get 1 | ||
i32.sub | ||
) | ||
(func (;2;) (type 2) (param i32 i32) (result i32) | ||
local.get 1 | ||
local.get 0 | ||
ref.func 1 | ||
cont.new 3 | ||
cont.bind 3 1 | ||
resume 1 | ||
) | ||
(func (;3;) (type 5) | ||
i32.const 22 | ||
i32.const 44 | ||
call 2 | ||
call 0 | ||
) | ||
) |
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,18 @@ | ||
(module definition binary | ||
"\00\61\73\6d\01\00\00\00\01\90\80\80\80\00\04\60" | ||
"\01\7f\01\7f\5d\00\60\02\7f\7f\01\7f\5d\02\03\83" | ||
"\80\80\80\00\02\02\02\07\88\80\80\80\00\01\04\6d" | ||
"\61\69\6e\00\01\09\85\80\80\80\00\01\03\00\01\00" | ||
"\0a\a2\80\80\80\00\02\87\80\80\80\00\00\20\00\20" | ||
"\01\6b\0b\90\80\80\80\00\00\20\01\20\00\d2\00\e0" | ||
"\03\e1\03\01\e3\01\00\0b" | ||
) | ||
(module instance) | ||
(assert_return | ||
(invoke "main" (i32.const 0x16) (i32.const 0x2c)) | ||
(i32.const 0xffff_ffea) | ||
) | ||
(assert_return | ||
(invoke "main" (i32.const 0xffff_fe44) (i32.const 0x6f)) | ||
(i32.const 0xffff_fdd5) | ||
) |
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,25 @@ | ||
(module | ||
;; (type $f1 (func (result i32))) | ||
;; (type $c1 (cont $f1)) | ||
|
||
(type $f2 (func (param i32) (result i32))) | ||
(type $c2 (cont $f2)) | ||
|
||
(type $f3 (func (param i32 i32) (result i32))) | ||
(type $c3 (cont $f3)) | ||
|
||
(func $sub (param i32 i32) (result i32) (i32.sub (local.get 0) (local.get 1))) | ||
(elem declare func $sub) | ||
|
||
(func (export "main") (param i32 i32) (result i32) | ||
(resume $c2 | ||
(local.get 1) | ||
(cont.bind $c3 $c2 | ||
(local.get 0) | ||
(cont.new $c3 (ref.func $sub)))) | ||
) | ||
) | ||
|
||
;; (assert_return (invoke "main" (i32.const 22) (i32.const 44)) (i32.const -22)) | ||
;; (assert_return (invoke "main" (i32.const -444) (i32.const 111)) (i32.const -555)) | ||
|
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
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