mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-04-25 06:02:13 +00:00
39 lines
1.0 KiB
Plaintext
39 lines
1.0 KiB
Plaintext
|
;; @xform export "foo" (anyref_owned)
|
||
|
|
||
|
(module
|
||
|
(import "__wbindgen_anyref_xform__" "__wbindgen_anyref_table_set_null"
|
||
|
(func $set-null (param i32)))
|
||
|
(func $foo (export "foo") (param i32)
|
||
|
local.get 0
|
||
|
call $set-null)
|
||
|
(func $alloc (export "__wbindgen_anyref_table_alloc") (result i32)
|
||
|
i32.const 0)
|
||
|
(func $dealloc (export "__wbindgen_anyref_table_dealloc") (param i32))
|
||
|
)
|
||
|
|
||
|
(; CHECK-ALL:
|
||
|
(module
|
||
|
(type (;0;) (func (result i32)))
|
||
|
(type (;1;) (func (param i32)))
|
||
|
(type (;2;) (func (param anyref)))
|
||
|
(func $foo anyref shim (type 2) (param anyref)
|
||
|
(local i32)
|
||
|
call $alloc
|
||
|
local.tee 1
|
||
|
local.get 0
|
||
|
table.set 0
|
||
|
local.get 1
|
||
|
call $foo)
|
||
|
(func $foo (type 1) (param i32)
|
||
|
local.get 0
|
||
|
ref.null
|
||
|
table.set 0)
|
||
|
(func $alloc (type 0) (result i32)
|
||
|
i32.const 0)
|
||
|
(func $dealloc (type 1) (param i32))
|
||
|
(table (;0;) 32 anyref)
|
||
|
(export "foo" (func $foo anyref shim))
|
||
|
(export "__wbindgen_anyref_table_alloc" (func $alloc))
|
||
|
(export "__wbindgen_anyref_table_dealloc" (func $dealloc)))
|
||
|
;)
|