Files
cli/vendor/wit-component/tests/components/resource-used-through-import/component.wat

58 lines
1.9 KiB
Plaintext
Raw Normal View History

(component
(type $ty-foo:bar/a (;0;)
(instance
(export (;0;) "r" (type (sub resource)))
)
)
(import "foo:bar/a" (instance $foo:bar/a (;0;) (type $ty-foo:bar/a)))
(core module $main (;0;)
(type (;0;) (func (param i32)))
(type (;1;) (func (result i32)))
(import "foo:bar/a" "[resource-drop]r" (func (;0;) (type 0)))
(export "b#foo" (func 1))
(func (;1;) (type 1) (result i32)
i32.const 0
)
(@producers
(processed-by "wit-component" "$CARGO_PKG_VERSION")
(processed-by "my-fake-bindgen" "123.45")
)
)
(alias export $foo:bar/a "r" (type $r (;1;)))
(alias export $foo:bar/a "r" (type $"#type2 r" (@name "r") (;2;)))
(core func $resource.drop (;0;) (canon resource.drop $"#type2 r"))
(core instance $foo:bar/a (;0;)
(export "[resource-drop]r" (func $resource.drop))
)
(core instance $main (;1;) (instantiate $main
(with "foo:bar/a" (instance $foo:bar/a))
)
)
(type (;3;) (own $r))
(type (;4;) (func (result 3)))
(alias core export $main "b#foo" (core func $b#foo (;1;)))
(func $foo (;0;) (type 4) (canon lift (core func $b#foo)))
(alias export $foo:bar/a "r" (type $"#type5 r" (@name "r") (;5;)))
(component $b-shim-component (;0;)
(import "import-type-r" (type (;0;) (sub resource)))
(import "import-type-r0" (type (;1;) (eq 0)))
(type (;2;) (own 1))
(type (;3;) (func (result 2)))
(import "import-func-foo" (func (;0;) (type 3)))
(export (;4;) "r" (type 0))
(type (;5;) (own 4))
(type (;6;) (func (result 5)))
(export (;1;) "foo" (func 0) (func (type 6)))
)
(instance $b-shim-instance (;1;) (instantiate $b-shim-component
(with "import-func-foo" (func $foo))
(with "import-type-r" (type $"#type5 r"))
(with "import-type-r0" (type $r))
)
)
(export $b (;2;) "b" (instance $b-shim-instance))
(@producers
(processed-by "wit-component" "$CARGO_PKG_VERSION")
)
)