wasm: Add support for passive data and element segments (#1389)
This is part of the bulk memory and reference types proposals.
This commit is contained in:
11
cranelift/wasmtests/passive-data.wat
Normal file
11
cranelift/wasmtests/passive-data.wat
Normal file
@@ -0,0 +1,11 @@
|
||||
(module
|
||||
(data $passive "this is a passive data segment")
|
||||
|
||||
(func (export "init") (param i32 i32 i32)
|
||||
local.get 0 ;; dst
|
||||
local.get 1 ;; src
|
||||
local.get 2 ;; cnt
|
||||
memory.init $passive)
|
||||
|
||||
(func (export "drop")
|
||||
data.drop $passive))
|
||||
22
cranelift/wasmtests/table-copy.wat
Normal file
22
cranelift/wasmtests/table-copy.wat
Normal file
@@ -0,0 +1,22 @@
|
||||
(module $n
|
||||
(table $t (import "m" "t") 6 funcref)
|
||||
|
||||
(func $i (param i32 i32 i32 i32 i32 i32) (result i32) (local.get 3))
|
||||
(func $j (param i32 i32 i32 i32 i32 i32) (result i32) (local.get 4))
|
||||
(func $k (param i32 i32 i32 i32 i32 i32) (result i32) (local.get 5))
|
||||
|
||||
(table $u (export "u") funcref (elem $i $j $k $i $j $k))
|
||||
|
||||
(func (export "copy_to_t_from_u") (param i32 i32 i32 i32) (result i32)
|
||||
local.get 0
|
||||
local.get 1
|
||||
local.get 2
|
||||
local.get 3
|
||||
table.copy $t $u)
|
||||
|
||||
(func (export "copy_to_u_from_t") (param i32 i32 i32 i32) (result i32)
|
||||
local.get 0
|
||||
local.get 1
|
||||
local.get 2
|
||||
local.get 3
|
||||
table.copy $u $t))
|
||||
Reference in New Issue
Block a user