Debian Codegraph @

crates/wit-component/tests/components/import-export/component.wat

raw
1 (component
2 (type (;0;)
3 (instance
4 (type (;0;) (func (result string)))
5 (export (;0;) "a" (func (type 0)))
6 )
7 )
8 (import "foo" (instance (;0;) (type 0)))
9 (core module (;0;)
10 (type (;0;) (func (param i32)))
11 (type (;1;) (func (param i32 i32 i32 i32) (result i32)))
12 (type (;2;) (func (param i32 i32) (result i32)))
13 (type (;3;) (func))
14 (type (;4;) (func (result i32)))
15 (import "foo" "a" (func (;0;) (type 0)))
16 (memory (;0;) 1)
17 (export "memory" (memory 0))
18 (export "cabi_realloc" (func 1))
19 (export "a" (func 2))
20 (export "cabi_post_a" (func 3))
21 (export "bar#a" (func 4))
22 (export "bar#b" (func 5))
23 (export "cabi_post_bar#b" (func 6))
24 (func (;1;) (type 1) (param i32 i32 i32 i32) (result i32)
25 unreachable
26 )
27 (func (;2;) (type 2) (param i32 i32) (result i32)
28 unreachable
29 )
30 (func (;3;) (type 0) (param i32)
31 unreachable
32 )
33 (func (;4;) (type 3)
34 unreachable
35 )
36 (func (;5;) (type 4) (result i32)
37 unreachable
38 )
39 (func (;6;) (type 0) (param i32)
40 unreachable
41 )
42 (@producers
43 (processed-by "wit-component" "$CARGO_PKG_VERSION")
44 (processed-by "my-fake-bindgen" "123.45")
45 )
46 )
47 (core module (;1;)
48 (type (;0;) (func (param i32)))
49 (table (;0;) 1 1 funcref)
50 (export "0" (func $indirect-foo-a))
51 (export "$imports" (table 0))
52 (func $indirect-foo-a (;0;) (type 0) (param i32)
53 local.get 0
54 i32.const 0
55 call_indirect (type 0)
56 )
57 (@producers
58 (processed-by "wit-component" "$CARGO_PKG_VERSION")
59 )
60 )
61 (core module (;2;)
62 (type (;0;) (func (param i32)))
63 (import "" "0" (func (;0;) (type 0)))
64 (import "" "$imports" (table (;0;) 1 1 funcref))
65 (elem (;0;) (i32.const 0) func 0)
66 (@producers
67 (processed-by "wit-component" "$CARGO_PKG_VERSION")
68 )
69 )
70 (core instance (;0;) (instantiate 1))
71 (alias core export 0 "0" (core func (;0;)))
72 (core instance (;1;)
73 (export "a" (func 0))
74 )
75 (core instance (;2;) (instantiate 0
76 (with "foo" (instance 1))
77 )
78 )
79 (alias core export 2 "memory" (core memory (;0;)))
80 (alias core export 0 "$imports" (core table (;0;)))
81 (alias export 0 "a" (func (;0;)))
82 (alias core export 2 "cabi_realloc" (core func (;1;)))
83 (core func (;2;) (canon lower (func 0) (memory 0) (realloc 1) string-encoding=utf8))
84 (core instance (;3;)
85 (export "$imports" (table 0))
86 (export "0" (func 2))
87 )
88 (core instance (;4;) (instantiate 2
89 (with "" (instance 3))
90 )
91 )
92 (type (;1;) (tuple string u32 string))
93 (type (;2;) (func (param "x" string) (result 1)))
94 (alias core export 2 "a" (core func (;3;)))
95 (alias core export 2 "cabi_post_a" (core func (;4;)))
96 (func (;1;) (type 2) (canon lift (core func 3) (memory 0) (realloc 1) string-encoding=utf8 (post-return 4)))
97 (export (;2;) "a" (func 1))
98 (type (;3;) (func))
99 (alias core export 2 "bar#a" (core func (;5;)))
100 (func (;3;) (type 3) (canon lift (core func 5)))
101 (type (;4;) (func (result string)))
102 (alias core export 2 "bar#b" (core func (;6;)))
103 (alias core export 2 "cabi_post_bar#b" (core func (;7;)))
104 (func (;4;) (type 4) (canon lift (core func 6) (memory 0) string-encoding=utf8 (post-return 7)))
105 (component (;0;)
106 (type (;0;) (func))
107 (import "import-func-a" (func (;0;) (type 0)))
108 (type (;1;) (func (result string)))
109 (import "import-func-b" (func (;1;) (type 1)))
110 (type (;2;) (func))
111 (export (;2;) "a" (func 0) (func (type 2)))
112 (type (;3;) (func (result string)))
113 (export (;3;) "b" (func 1) (func (type 3)))
114 )
115 (instance (;1;) (instantiate 0
116 (with "import-func-a" (func 3))
117 (with "import-func-b" (func 4))
118 )
119 )
120 (export (;2;) "bar" (instance 1))
121 (@producers
122 (processed-by "wit-component" "$CARGO_PKG_VERSION")
123 )
124 )