forked from bytecodealliance/wasm-tools
-
Notifications
You must be signed in to change notification settings - Fork 1
/
composed.wat
170 lines (170 loc) · 6.5 KB
/
composed.wat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
(component
(type (;0;)
(component
(type (;0;) (record (field "a" s8) (field "b" u8) (field "c" s16) (field "d" u16) (field "e" s32) (field "f" u32) (field "g" s64) (field "h" u64) (field "i" float32) (field "j" float64) (field "k" bool) (field "l" string)))
(export "record1" (type (eq 0)))
(type (;1;) (flags "a" "b" "c"))
(export "flags1" (type (eq 1)))
(type (;2;) (enum "a" "b" "c"))
(export "enum1" (type (eq 2)))
(type (;3;) (union s8 string 0))
(export "union1" (type (eq 3)))
(type (;4;) (variant (case "a" s8) (case "b" u8) (case "c" s16) (case "d" u16) (case "e" s32) (case "f" u32) (case "g" s64) (case "h" u64) (case "i" float32) (case "j" float64) (case "k" bool) (case "l" string) (case "m" 0)))
(export "variant1" (type (eq 4)))
(type (;5;) (func))
(export "a" (func (type 5)))
(type (;6;) (func (param "x" s8)))
(export "b" (func (type 6)))
(type (;7;) (func (param "x" u8)))
(export "c" (func (type 7)))
(type (;8;) (func (param "x" s16)))
(export "d" (func (type 8)))
(type (;9;) (func (param "x" u16)))
(export "e" (func (type 9)))
(type (;10;) (func (param "x" s32)))
(export "f" (func (type 10)))
(type (;11;) (func (param "x" u32)))
(export "g" (func (type 11)))
(type (;12;) (func (param "x" s64)))
(export "h" (func (type 12)))
(type (;13;) (func (param "x" u64)))
(export "i" (func (type 13)))
(type (;14;) (func (param "x" float32)))
(export "j" (func (type 14)))
(type (;15;) (func (param "x" float64)))
(export "k" (func (type 15)))
(type (;16;) (func (param "x" bool)))
(export "l" (func (type 16)))
(type (;17;) (func (param "x" string)))
(export "m" (func (type 17)))
(type (;18;) (func (param "x" 0)))
(export "n" (func (type 18)))
(type (;19;) (list 0))
(type (;20;) (func (param "x" 19)))
(export "o" (func (type 20)))
(type (;21;) (tuple 0 string))
(type (;22;) (func (param "x" 21)))
(export "p" (func (type 22)))
(type (;23;) (func (param "x" 1)))
(export "q" (func (type 23)))
(type (;24;) (func (param "x" 2)))
(export "r" (func (type 24)))
(type (;25;) (func (param "x" 3)))
(export "s" (func (type 25)))
(type (;26;) (option 4))
(type (;27;) (func (param "x" 26)))
(export "t" (func (type 27)))
(type (;28;) (result 0 (error string)))
(type (;29;) (func (result 28)))
(export "u" (func (type 29)))
)
)
(import "a" (component (;0;) (type 0)))
(instance (;0;) (instantiate 0))
(type (;1;)
(component
(type (;0;)
(instance
(type (;0;) (func))
(export "a" (func (type 0)))
(type (;1;) (func (param "x" s8)))
(export "b" (func (type 1)))
(type (;2;) (func (param "x" u8)))
(export "c" (func (type 2)))
(type (;3;) (func (param "x" s16)))
(export "d" (func (type 3)))
(type (;4;) (func (param "x" u16)))
(export "e" (func (type 4)))
(type (;5;) (func (param "x" s32)))
(export "f" (func (type 5)))
(type (;6;) (func (param "x" u32)))
(export "g" (func (type 6)))
(type (;7;) (func (param "x" s64)))
(export "h" (func (type 7)))
(type (;8;) (func (param "x" u64)))
(export "i" (func (type 8)))
(type (;9;) (func (param "x" float32)))
(export "j" (func (type 9)))
(type (;10;) (func (param "x" float64)))
(export "k" (func (type 10)))
(type (;11;) (func (param "x" bool)))
(export "l" (func (type 11)))
(type (;12;) (func (param "x" string)))
(export "m" (func (type 12)))
(type (;13;) (record (field "a" s8) (field "b" u8) (field "c" s16) (field "d" u16) (field "e" s32) (field "f" u32) (field "g" s64) (field "h" u64) (field "i" float32) (field "j" float64) (field "k" bool) (field "l" string)))
(export "record1" (type (eq 13)))
(type (;14;) (func (param "x" 13)))
(export "n" (func (type 14)))
(type (;15;) (list 13))
(type (;16;) (func (param "x" 15)))
(export "o" (func (type 16)))
(type (;17;) (tuple 13 string))
(type (;18;) (func (param "x" 17)))
(export "p" (func (type 18)))
(type (;19;) (flags "a" "b" "c"))
(export "flags1" (type (eq 19)))
(type (;20;) (func (param "x" 19)))
(export "q" (func (type 20)))
(type (;21;) (enum "a" "b" "c"))
(export "enum1" (type (eq 21)))
(type (;22;) (func (param "x" 21)))
(export "r" (func (type 22)))
(type (;23;) (union s8 string 13))
(export "union1" (type (eq 23)))
(type (;24;) (func (param "x" 23)))
(export "s" (func (type 24)))
(type (;25;) (variant (case "a" s8) (case "b" u8) (case "c" s16) (case "d" u16) (case "e" s32) (case "f" u32) (case "g" s64) (case "h" u64) (case "i" float32) (case "j" float64) (case "k" bool) (case "l" string) (case "m" 13)))
(export "variant1" (type (eq 25)))
(type (;26;) (option 25))
(type (;27;) (func (param "x" 26)))
(export "t" (func (type 27)))
(type (;28;) (result 13 (error string)))
(type (;29;) (func (result 28)))
(export "u" (func (type 29)))
)
)
(import "a" (instance (type 0)))
(type (;1;)
(instance
(type (;0;) (func (param "x" string) (result string)))
(export "m" (func (type 0)))
)
)
(export "x" (instance (type 1)))
)
)
(import "b" (component (;1;) (type 1)))
(instance (;1;) (instantiate 1
(with "a" (instance 0))
)
)
(instance (;2;) (instantiate 1
(with "a" (instance 0))
)
)
(component (;2;)
(type (;0;)
(instance
(type (;0;) (func (param "x" string) (result string)))
(export "m" (func (type 0)))
)
)
(import "b1" (instance (;0;) (type 0)))
(import "b2" (instance (;1;) (type 0)))
(alias export 0 "m" (func (;0;)))
(alias export 1 "m" (func (;1;)))
(export "m1" (func 0))
(export "m2" (func 1))
)
(alias export 1 "x" (instance (;3;)))
(alias export 2 "x" (instance (;4;)))
(instance (;5;) (instantiate 2
(with "b2" (instance 3))
(with "b1" (instance 4))
)
)
(alias export 5 "m1" (func (;0;)))
(alias export 5 "m2" (func (;1;)))
(export "m1" (func 0))
(export "m2" (func 1))
)