-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow table.copy between tables with different index types (#58)
- Loading branch information
Showing
4 changed files
with
53 additions
and
8 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
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,48 @@ | ||
;; Valid cases | ||
(module | ||
(table $t32 30 30 funcref) | ||
(table $t64 i64 30 30 funcref) | ||
|
||
(func (export "test32") | ||
(table.copy $t32 $t32 (i32.const 13) (i32.const 2) (i32.const 3))) | ||
|
||
(func (export "test64") | ||
(table.copy $t64 $t64 (i64.const 13) (i64.const 2) (i64.const 3))) | ||
|
||
(func (export "test_64to32") | ||
(table.copy $t32 $t64 (i32.const 13) (i64.const 2) (i32.const 3))) | ||
|
||
(func (export "test_32to64") | ||
(table.copy $t64 $t32 (i64.const 13) (i32.const 2) (i32.const 3))) | ||
) | ||
|
||
;; Invalid cases | ||
(assert_invalid (module | ||
(table $t32 30 30 funcref) | ||
(table $t64 i64 30 30 funcref) | ||
|
||
(func (export "bad_size_arg") | ||
(table.copy $t32 $t64 (i32.const 13) (i64.const 2) (i64.const 3))) | ||
) | ||
"type mismatch" | ||
) | ||
|
||
(assert_invalid (module | ||
(table $t32 30 30 funcref) | ||
(table $t64 i64 30 30 funcref) | ||
|
||
(func (export "bad_src_idx") | ||
(table.copy $t32 $t64 (i32.const 13) (i32.const 2) (i32.const 3))) | ||
) | ||
"type mismatch" | ||
) | ||
|
||
(assert_invalid (module | ||
(table $t32 30 30 funcref) | ||
(table $t64 i64 30 30 funcref) | ||
|
||
(func (export "bad_dst_idx") | ||
(table.copy $t32 $t64 (i64.const 13) (i64.const 2) (i32.const 3))) | ||
) | ||
"type mismatch" | ||
) |