Files
cli/vendor/wit-component/tests/components/export-resource/component.wat

103 lines
3.9 KiB
Plaintext
Raw Normal View History

(component
(core module $main (;0;)
(type (;0;) (func (param i32) (result i32)))
(type (;1;) (func (param i32)))
(type (;2;) (func (result i32)))
(import "[export]foo" "[resource-new]a" (func $new (;0;) (type 0)))
(import "[export]foo" "[resource-rep]a" (func (;1;) (type 0)))
(import "[export]foo" "[resource-drop]a" (func (;2;) (type 1)))
(export "foo#[constructor]a" (func 3))
(export "foo#[static]a.other-new" (func 4))
(export "foo#[dtor]a" (func 5))
(func (;3;) (type 2) (result i32)
i32.const 100
call $new
)
(func (;4;) (type 2) (result i32)
i32.const 200
call $new
)
(func (;5;) (type 1) (param i32))
(@producers
(processed-by "wit-component" "$CARGO_PKG_VERSION")
(processed-by "my-fake-bindgen" "123.45")
)
)
(core module $wit-component-shim-module (;1;)
(type (;0;) (func (param i32)))
(table (;0;) 1 1 funcref)
(export "0" (func $dtor-a))
(export "$imports" (table 0))
(func $dtor-a (;0;) (type 0) (param i32)
local.get 0
i32.const 0
call_indirect (type 0)
)
(@producers
(processed-by "wit-component" "$CARGO_PKG_VERSION")
)
)
(core module $wit-component-fixup (;2;)
(type (;0;) (func (param i32)))
(import "" "0" (func (;0;) (type 0)))
(import "" "$imports" (table (;0;) 1 1 funcref))
(elem (;0;) (i32.const 0) func 0)
(@producers
(processed-by "wit-component" "$CARGO_PKG_VERSION")
)
)
(core instance $wit-component-shim-instance (;0;) (instantiate $wit-component-shim-module))
(alias core export $wit-component-shim-instance "0" (core func $dtor-a (;0;)))
(type $a (;0;) (resource (rep i32) (dtor (func $dtor-a))))
(core func $resource.new (;1;) (canon resource.new $a))
(core func $resource.rep (;2;) (canon resource.rep $a))
(core func $resource.drop (;3;) (canon resource.drop $a))
(core instance $"[export]foo" (;1;)
(export "[resource-new]a" (func $resource.new))
(export "[resource-rep]a" (func $resource.rep))
(export "[resource-drop]a" (func $resource.drop))
)
(core instance $main (;2;) (instantiate $main
(with "[export]foo" (instance $"[export]foo"))
)
)
(alias core export $wit-component-shim-instance "$imports" (core table $"shim table" (;0;)))
(alias core export $main "foo#[dtor]a" (core func $"foo#[dtor]a" (;4;)))
(core instance $fixup-args (;3;)
(export "$imports" (table $"shim table"))
(export "0" (func $"foo#[dtor]a"))
)
(core instance $fixup (;4;) (instantiate $wit-component-fixup
(with "" (instance $fixup-args))
)
)
(type (;1;) (own $a))
(type (;2;) (func (result 1)))
(alias core export $main "foo#[constructor]a" (core func $"foo#[constructor]a" (;5;)))
(func $"[constructor]a" (;0;) (type 2) (canon lift (core func $"foo#[constructor]a")))
(alias core export $main "foo#[static]a.other-new" (core func $"foo#[static]a.other-new" (;6;)))
(func $"[static]a.other-new" (;1;) (type 2) (canon lift (core func $"foo#[static]a.other-new")))
(component $foo-shim-component (;0;)
(import "import-type-a" (type (;0;) (sub resource)))
(type (;1;) (own 0))
(type (;2;) (func (result 1)))
(import "import-constructor-a" (func (;0;) (type 2)))
(import "import-static-a-other-new" (func (;1;) (type 2)))
(export (;3;) "a" (type 0))
(type (;4;) (own 3))
(type (;5;) (func (result 4)))
(export (;2;) "[constructor]a" (func 0) (func (type 5)))
(export (;3;) "[static]a.other-new" (func 1) (func (type 5)))
)
(instance $foo-shim-instance (;0;) (instantiate $foo-shim-component
(with "import-constructor-a" (func $"[constructor]a"))
(with "import-static-a-other-new" (func $"[static]a.other-new"))
(with "import-type-a" (type $a))
)
)
(export $foo (;1;) "foo" (instance $foo-shim-instance))
(@producers
(processed-by "wit-component" "$CARGO_PKG_VERSION")
)
)