Files
cli/vendor/wit-component/tests/components/adapt-import-only-used-in-adapter/component.wat

116 lines
4.5 KiB
Plaintext

(component
(type $ty-foo:foo/adapter-imports (;0;)
(instance
(type (;0;) (func (param "x" string)))
(export (;0;) "foo" (func (type 0)))
)
)
(import "foo:foo/adapter-imports" (instance $foo:foo/adapter-imports (;0;) (type $ty-foo:foo/adapter-imports)))
(type (;1;) (func (param "x" string)))
(import "foo" (func $foo (;0;) (type 1)))
(core module $main (;0;)
(type (;0;) (func (param i32 i32)))
(type (;1;) (func))
(import "$root" "foo" (func (;0;) (type 0)))
(memory (;0;) 1)
(export "bar" (func 1))
(export "memory" (memory 0))
(func (;1;) (type 1)
unreachable
)
(@producers
(processed-by "wit-component" "$CARGO_PKG_VERSION")
(processed-by "my-fake-bindgen" "123.45")
)
)
(core module $wit-component:adapter:unused (;1;)
(type (;0;) (func (param i32 i32)))
(type (;1;) (func (param i32 i32 i32 i32) (result i32)))
(import "foo:foo/adapter-imports" "foo" (func $foo (;0;) (type 0)))
(export "adapter-bar" (func 1))
(export "cabi_export_realloc" (func 2))
(func (;1;) (type 0) (param i32 i32)
i32.const 0
i32.const 0
call $foo
)
(func (;2;) (type 1) (param i32 i32 i32 i32) (result i32)
unreachable
)
)
(core module $wit-component-shim-module (;2;)
(type (;0;) (func (param i32 i32)))
(table (;0;) 2 2 funcref)
(export "0" (func $indirect-$root-foo))
(export "1" (func $indirect-foo:foo/adapter-imports-foo))
(export "$imports" (table 0))
(func $indirect-$root-foo (;0;) (type 0) (param i32 i32)
local.get 0
local.get 1
i32.const 0
call_indirect (type 0)
)
(func $indirect-foo:foo/adapter-imports-foo (;1;) (type 0) (param i32 i32)
local.get 0
local.get 1
i32.const 1
call_indirect (type 0)
)
(@producers
(processed-by "wit-component" "$CARGO_PKG_VERSION")
)
)
(core module $wit-component-fixup (;3;)
(type (;0;) (func (param i32 i32)))
(import "" "0" (func (;0;) (type 0)))
(import "" "1" (func (;1;) (type 0)))
(import "" "$imports" (table (;0;) 2 2 funcref))
(elem (;0;) (i32.const 0) func 0 1)
(@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 $indirect-$root-foo (;0;)))
(core instance $$root (;1;)
(export "foo" (func $indirect-$root-foo))
)
(core instance $main (;2;) (instantiate $main
(with "$root" (instance $$root))
)
)
(alias core export $main "memory" (core memory $memory (;0;)))
(alias core export $wit-component-shim-instance "1" (core func $indirect-foo:foo/adapter-imports-foo (;1;)))
(core instance $foo:foo/adapter-imports (;3;)
(export "foo" (func $indirect-foo:foo/adapter-imports-foo))
)
(core instance $unused (;4;) (instantiate $wit-component:adapter:unused
(with "foo:foo/adapter-imports" (instance $foo:foo/adapter-imports))
)
)
(alias core export $wit-component-shim-instance "$imports" (core table $"shim table" (;0;)))
(core func $"#core-func2 indirect-$root-foo" (@name "indirect-$root-foo") (;2;) (canon lower (func $foo) (memory $memory) string-encoding=utf8))
(alias export $foo:foo/adapter-imports "foo" (func $"#func1 foo" (@name "foo") (;1;)))
(core func $"#core-func3 indirect-foo:foo/adapter-imports-foo" (@name "indirect-foo:foo/adapter-imports-foo") (;3;) (canon lower (func $"#func1 foo") (memory $memory) string-encoding=utf8))
(core instance $fixup-args (;5;)
(export "$imports" (table $"shim table"))
(export "0" (func $"#core-func2 indirect-$root-foo"))
(export "1" (func $"#core-func3 indirect-foo:foo/adapter-imports-foo"))
)
(core instance $fixup (;6;) (instantiate $wit-component-fixup
(with "" (instance $fixup-args))
)
)
(type (;2;) (func))
(alias core export $main "bar" (core func $bar (;4;)))
(func $bar (;2;) (type 2) (canon lift (core func $bar)))
(export $"#func3 bar" (@name "bar") (;3;) "bar" (func $bar))
(alias core export $unused "adapter-bar" (core func $adapter-bar (;5;)))
(alias core export $unused "cabi_export_realloc" (core func $cabi_export_realloc (;6;)))
(func $adapter-bar (;4;) (type 1) (canon lift (core func $adapter-bar) (memory $memory) (realloc $cabi_export_realloc) string-encoding=utf8))
(export $"#func5 adapter-bar" (@name "adapter-bar") (;5;) "adapter-bar" (func $adapter-bar))
(@producers
(processed-by "wit-component" "$CARGO_PKG_VERSION")
)
)