Debian Codegraph @

tests/snapshots/testsuite/proposals/wasm-3.0/call_indirect.wast/0.print

raw
1 (module
2 (type $proc (;0;) (func))
3 (type $out-i32 (;1;) (func (result i32)))
4 (type $out-i64 (;2;) (func (result i64)))
5 (type $out-f32 (;3;) (func (result f32)))
6 (type $out-f64 (;4;) (func (result f64)))
7 (type $out-f64-i32 (;5;) (func (result f64 i32)))
8 (type $over-i32 (;6;) (func (param i32) (result i32)))
9 (type $over-i64 (;7;) (func (param i64) (result i64)))
10 (type $over-f32 (;8;) (func (param f32) (result f32)))
11 (type $over-f64 (;9;) (func (param f64) (result f64)))
12 (type $over-i32-f64 (;10;) (func (param i32 f64) (result i32 f64)))
13 (type $swap-i32-i64 (;11;) (func (param i32 i64) (result i64 i32)))
14 (type $f32-i32 (;12;) (func (param f32 i32) (result i32)))
15 (type $i32-i64 (;13;) (func (param i32 i64) (result i64)))
16 (type $f64-f32 (;14;) (func (param f64 f32) (result f32)))
17 (type $i64-f64 (;15;) (func (param i64 f64) (result f64)))
18 (type $over-i32-duplicate (;16;) (func (param i32) (result i32)))
19 (type $over-i64-duplicate (;17;) (func (param i64) (result i64)))
20 (type $over-f32-duplicate (;18;) (func (param f32) (result f32)))
21 (type $over-f64-duplicate (;19;) (func (param f64) (result f64)))
22 (type (;20;) (func (param i64)))
23 (type (;21;) (func (param i64 f64 i32 i64)))
24 (type (;22;) (func (param i64) (result i32)))
25 (type (;23;) (func (param i64 f64 i32 i64) (result i32)))
26 (type (;24;) (func (result i32 f64)))
27 (type (;25;) (func (result i64 i32)))
28 (type (;26;) (func (param i32) (result i64)))
29 (type (;27;) (func (param i32) (result f32)))
30 (type (;28;) (func (param i32) (result f64)))
31 (table (;0;) 32 32 funcref)
32 (table $t64 (;1;) i64 1 1 funcref)
33 (memory (;0;) 1)
34 (global $a (;0;) (mut f64) f64.const 0x1.4p+3 (;=10;))
35 (export "type-i32" (func 20))
36 (export "type-i32-t64" (func 21))
37 (export "type-i64" (func 22))
38 (export "type-f32" (func 23))
39 (export "type-f64" (func 24))
40 (export "type-f64-i32" (func 25))
41 (export "type-index" (func 26))
42 (export "type-first-i32" (func 27))
43 (export "type-first-i64" (func 28))
44 (export "type-first-f32" (func 29))
45 (export "type-first-f64" (func 30))
46 (export "type-second-i32" (func 31))
47 (export "type-second-i64" (func 32))
48 (export "type-second-f32" (func 33))
49 (export "type-second-f64" (func 34))
50 (export "type-all-f64-i32" (func 35))
51 (export "type-all-i32-f64" (func 36))
52 (export "type-all-i32-i64" (func 37))
53 (export "dispatch" (func 38))
54 (export "dispatch-structural-i64" (func 39))
55 (export "dispatch-structural-i32" (func 40))
56 (export "dispatch-structural-f32" (func 41))
57 (export "dispatch-structural-f64" (func 42))
58 (export "fac-i64" (func $fac-i64))
59 (export "fib-i64" (func $fib-i64))
60 (export "fac-i32" (func $fac-i32))
61 (export "fac-f32" (func $fac-f32))
62 (export "fac-f64" (func $fac-f64))
63 (export "fib-i32" (func $fib-i32))
64 (export "fib-f32" (func $fib-f32))
65 (export "fib-f64" (func $fib-f64))
66 (export "even" (func $even))
67 (export "odd" (func $odd))
68 (export "runaway" (func $runaway))
69 (export "mutual-runaway" (func $mutual-runaway1))
70 (export "as-select-first" (func 56))
71 (export "as-select-mid" (func 57))
72 (export "as-select-last" (func 58))
73 (export "as-if-condition" (func 59))
74 (export "as-br_if-first" (func 60))
75 (export "as-br_if-last" (func 61))
76 (export "as-br_table-first" (func 62))
77 (export "as-br_table-last" (func 63))
78 (export "as-store-first" (func 64))
79 (export "as-store-last" (func 65))
80 (export "as-memory.grow-value" (func 66))
81 (export "as-return-value" (func 67))
82 (export "as-drop-operand" (func 68))
83 (export "as-br-value" (func 69))
84 (export "as-local.set-value" (func 70))
85 (export "as-local.tee-value" (func 71))
86 (export "as-global.set-value" (func 72))
87 (export "as-load-operand" (func 73))
88 (export "as-unary-operand" (func 74))
89 (export "as-binary-left" (func 75))
90 (export "as-binary-right" (func 76))
91 (export "as-test-operand" (func 77))
92 (export "as-compare-left" (func 78))
93 (export "as-compare-right" (func 79))
94 (export "as-convert-operand" (func 80))
95 (elem (;0;) (table 0) (i32.const 0) func $const-i32 $const-i64 $const-f32 $const-f64 $id-i32 $id-i64 $id-f32 $id-f64 $f32-i32 $i32-i64 $f64-f32 $i64-f64 $fac-i64 $fib-i64 $even $odd $runaway $mutual-runaway1 $mutual-runaway2 $over-i32-duplicate $over-i64-duplicate $over-f32-duplicate $over-f64-duplicate $fac-i32 $fac-f32 $fac-f64 $fib-i32 $fib-f32 $fib-f64 $const-f64-i32 $id-i32-f64 $swap-i32-i64)
96 (elem (;1;) (table $t64) (i64.const 0) func $const-i32)
97 (func $const-i32 (;0;) (type $out-i32) (result i32)
98 i32.const 306
99 )
100 (func $const-i64 (;1;) (type $out-i64) (result i64)
101 i64.const 356
102 )
103 (func $const-f32 (;2;) (type $out-f32) (result f32)
104 f32.const 0x1.e64p+11 (;=3890;)
105 )
106 (func $const-f64 (;3;) (type $out-f64) (result f64)
107 f64.const 0x1.ec8p+11 (;=3940;)
108 )
109 (func $const-f64-i32 (;4;) (type $out-f64-i32) (result f64 i32)
110 f64.const 0x1.ec8p+11 (;=3940;)
111 i32.const 32
112 )
113 (func $id-i32 (;5;) (type $over-i32) (param i32) (result i32)
114 local.get 0
115 )
116 (func $id-i64 (;6;) (type $over-i64) (param i64) (result i64)
117 local.get 0
118 )
119 (func $id-f32 (;7;) (type $over-f32) (param f32) (result f32)
120 local.get 0
121 )
122 (func $id-f64 (;8;) (type $over-f64) (param f64) (result f64)
123 local.get 0
124 )
125 (func $id-i32-f64 (;9;) (type $over-i32-f64) (param i32 f64) (result i32 f64)
126 local.get 0
127 local.get 1
128 )
129 (func $swap-i32-i64 (;10;) (type $swap-i32-i64) (param i32 i64) (result i64 i32)
130 local.get 1
131 local.get 0
132 )
133 (func $i32-i64 (;11;) (type $i32-i64) (param i32 i64) (result i64)
134 local.get 1
135 )
136 (func $i64-f64 (;12;) (type $i64-f64) (param i64 f64) (result f64)
137 local.get 1
138 )
139 (func $f32-i32 (;13;) (type $f32-i32) (param f32 i32) (result i32)
140 local.get 1
141 )
142 (func $f64-f32 (;14;) (type $f64-f32) (param f64 f32) (result f32)
143 local.get 1
144 )
145 (func $over-i32-duplicate (;15;) (type $over-i32-duplicate) (param i32) (result i32)
146 local.get 0
147 )
148 (func $over-i64-duplicate (;16;) (type $over-i64-duplicate) (param i64) (result i64)
149 local.get 0
150 )
151 (func $over-f32-duplicate (;17;) (type $over-f32-duplicate) (param f32) (result f32)
152 local.get 0
153 )
154 (func $over-f64-duplicate (;18;) (type $over-f64-duplicate) (param f64) (result f64)
155 local.get 0
156 )
157 (func (;19;) (type $proc)
158 i32.const 0
159 call_indirect (type $proc)
160 i64.const 0
161 call_indirect $t64 (type $proc)
162 i64.const 0
163 i32.const 0
164 call_indirect (type 20)
165 i64.const 0
166 f64.const 0x0p+0 (;=0;)
167 i32.const 0
168 i64.const 0
169 i32.const 0
170 call_indirect (type 21)
171 i32.const 0
172 call_indirect (type $proc)
173 i32.const 0
174 call_indirect (type $out-i32)
175 i32.eqz
176 drop
177 i32.const 0
178 call_indirect (type $out-i32)
179 i32.eqz
180 drop
181 i64.const 0
182 i32.const 0
183 call_indirect (type 22)
184 i32.eqz
185 drop
186 i64.const 0
187 f64.const 0x0p+0 (;=0;)
188 i32.const 0
189 i64.const 0
190 i32.const 0
191 call_indirect (type 23)
192 i32.eqz
193 drop
194 i64.const 0
195 i32.const 0
196 call_indirect (type $over-i64)
197 i64.eqz
198 drop
199 )
200 (func (;20;) (type $out-i32) (result i32)
201 i32.const 0
202 call_indirect (type $out-i32)
203 )
204 (func (;21;) (type $out-i32) (result i32)
205 i64.const 0
206 call_indirect $t64 (type $out-i32)
207 )
208 (func (;22;) (type $out-i64) (result i64)
209 i32.const 1
210 call_indirect (type $out-i64)
211 )
212 (func (;23;) (type $out-f32) (result f32)
213 i32.const 2
214 call_indirect (type $out-f32)
215 )
216 (func (;24;) (type $out-f64) (result f64)
217 i32.const 3
218 call_indirect (type $out-f64)
219 )
220 (func (;25;) (type $out-f64-i32) (result f64 i32)
221 i32.const 29
222 call_indirect (type $out-f64-i32)
223 )
224 (func (;26;) (type $out-i64) (result i64)
225 i64.const 100
226 i32.const 5
227 call_indirect (type $over-i64)
228 )
229 (func (;27;) (type $out-i32) (result i32)
230 i32.const 32
231 i32.const 4
232 call_indirect (type $over-i32)
233 )
234 (func (;28;) (type $out-i64) (result i64)
235 i64.const 64
236 i32.const 5
237 call_indirect (type $over-i64)
238 )
239 (func (;29;) (type $out-f32) (result f32)
240 f32.const 0x1.51eb86p+0 (;=1.32;)
241 i32.const 6
242 call_indirect (type $over-f32)
243 )
244 (func (;30;) (type $out-f64) (result f64)
245 f64.const 0x1.a3d70a3d70a3dp+0 (;=1.64;)
246 i32.const 7
247 call_indirect (type $over-f64)
248 )
249 (func (;31;) (type $out-i32) (result i32)
250 f32.const 0x1.00ccccp+5 (;=32.1;)
251 i32.const 32
252 i32.const 8
253 call_indirect (type $f32-i32)
254 )
255 (func (;32;) (type $out-i64) (result i64)
256 i32.const 32
257 i64.const 64
258 i32.const 9
259 call_indirect (type $i32-i64)
260 )
261 (func (;33;) (type $out-f32) (result f32)
262 f64.const 0x1p+6 (;=64;)
263 f32.const 0x1p+5 (;=32;)
264 i32.const 10
265 call_indirect (type $f64-f32)
266 )
267 (func (;34;) (type $out-f64) (result f64)
268 i64.const 64
269 f64.const 0x1.0066666666666p+6 (;=64.1;)
270 i32.const 11
271 call_indirect (type $i64-f64)
272 )
273 (func (;35;) (type $out-f64-i32) (result f64 i32)
274 i32.const 29
275 call_indirect (type $out-f64-i32)
276 )
277 (func (;36;) (type 24) (result i32 f64)
278 i32.const 1
279 f64.const 0x1p+1 (;=2;)
280 i32.const 30
281 call_indirect (type $over-i32-f64)
282 )
283 (func (;37;) (type 25) (result i64 i32)
284 i32.const 1
285 i64.const 2
286 i32.const 31
287 call_indirect (type $swap-i32-i64)
288 )
289 (func (;38;) (type $i32-i64) (param i32 i64) (result i64)
290 local.get 1
291 local.get 0
292 call_indirect (type $over-i64)
293 )
294 (func (;39;) (type 26) (param i32) (result i64)
295 i64.const 9
296 local.get 0
297 call_indirect (type $over-i64-duplicate)
298 )
299 (func (;40;) (type $over-i32) (param i32) (result i32)
300 i32.const 9
301 local.get 0
302 call_indirect (type $over-i32-duplicate)
303 )
304 (func (;41;) (type 27) (param i32) (result f32)
305 f32.const 0x1.2p+3 (;=9;)
306 local.get 0
307 call_indirect (type $over-f32-duplicate)
308 )
309 (func (;42;) (type 28) (param i32) (result f64)
310 f64.const 0x1.2p+3 (;=9;)
311 local.get 0
312 call_indirect (type $over-f64-duplicate)
313 )
314 (func $fac-i64 (;43;) (type $over-i64) (param i64) (result i64)
315 local.get 0
316 i64.eqz
317 if (result i64) ;; label = @1
318 i64.const 1
319 else
320 local.get 0
321 local.get 0
322 i64.const 1
323 i64.sub
324 i32.const 12
325 call_indirect (type $over-i64)
326 i64.mul
327 end
328 )
329 (func $fib-i64 (;44;) (type $over-i64) (param i64) (result i64)
330 local.get 0
331 i64.const 1
332 i64.le_u
333 if (result i64) ;; label = @1
334 i64.const 1
335 else
336 local.get 0
337 i64.const 2
338 i64.sub
339 i32.const 13
340 call_indirect (type $over-i64)
341 local.get 0
342 i64.const 1
343 i64.sub
344 i32.const 13
345 call_indirect (type $over-i64)
346 i64.add
347 end
348 )
349 (func $fac-i32 (;45;) (type $over-i32) (param i32) (result i32)
350 local.get 0
351 i32.eqz
352 if (result i32) ;; label = @1
353 i32.const 1
354 else
355 local.get 0
356 local.get 0
357 i32.const 1
358 i32.sub
359 i32.const 23
360 call_indirect (type $over-i32)
361 i32.mul
362 end
363 )
364 (func $fac-f32 (;46;) (type $over-f32) (param f32) (result f32)
365 local.get 0
366 f32.const 0x0p+0 (;=0;)
367 f32.eq
368 if (result f32) ;; label = @1
369 f32.const 0x1p+0 (;=1;)
370 else
371 local.get 0
372 local.get 0
373 f32.const 0x1p+0 (;=1;)
374 f32.sub
375 i32.const 24
376 call_indirect (type $over-f32)
377 f32.mul
378 end
379 )
380 (func $fac-f64 (;47;) (type $over-f64) (param f64) (result f64)
381 local.get 0
382 f64.const 0x0p+0 (;=0;)
383 f64.eq
384 if (result f64) ;; label = @1
385 f64.const 0x1p+0 (;=1;)
386 else
387 local.get 0
388 local.get 0
389 f64.const 0x1p+0 (;=1;)
390 f64.sub
391 i32.const 25
392 call_indirect (type $over-f64)
393 f64.mul
394 end
395 )
396 (func $fib-i32 (;48;) (type $over-i32) (param i32) (result i32)
397 local.get 0
398 i32.const 1
399 i32.le_u
400 if (result i32) ;; label = @1
401 i32.const 1
402 else
403 local.get 0
404 i32.const 2
405 i32.sub
406 i32.const 26
407 call_indirect (type $over-i32)
408 local.get 0
409 i32.const 1
410 i32.sub
411 i32.const 26
412 call_indirect (type $over-i32)
413 i32.add
414 end
415 )
416 (func $fib-f32 (;49;) (type $over-f32) (param f32) (result f32)
417 local.get 0
418 f32.const 0x1p+0 (;=1;)
419 f32.le
420 if (result f32) ;; label = @1
421 f32.const 0x1p+0 (;=1;)
422 else
423 local.get 0
424 f32.const 0x1p+1 (;=2;)
425 f32.sub
426 i32.const 27
427 call_indirect (type $over-f32)
428 local.get 0
429 f32.const 0x1p+0 (;=1;)
430 f32.sub
431 i32.const 27
432 call_indirect (type $over-f32)
433 f32.add
434 end
435 )
436 (func $fib-f64 (;50;) (type $over-f64) (param f64) (result f64)
437 local.get 0
438 f64.const 0x1p+0 (;=1;)
439 f64.le
440 if (result f64) ;; label = @1
441 f64.const 0x1p+0 (;=1;)
442 else
443 local.get 0
444 f64.const 0x1p+1 (;=2;)
445 f64.sub
446 i32.const 28
447 call_indirect (type $over-f64)
448 local.get 0
449 f64.const 0x1p+0 (;=1;)
450 f64.sub
451 i32.const 28
452 call_indirect (type $over-f64)
453 f64.add
454 end
455 )
456 (func $even (;51;) (type $over-i32) (param i32) (result i32)
457 local.get 0
458 i32.eqz
459 if (result i32) ;; label = @1
460 i32.const 44
461 else
462 local.get 0
463 i32.const 1
464 i32.sub
465 i32.const 15
466 call_indirect (type $over-i32)
467 end
468 )
469 (func $odd (;52;) (type $over-i32) (param i32) (result i32)
470 local.get 0
471 i32.eqz
472 if (result i32) ;; label = @1
473 i32.const 99
474 else
475 local.get 0
476 i32.const 1
477 i32.sub
478 i32.const 14
479 call_indirect (type $over-i32)
480 end
481 )
482 (func $runaway (;53;) (type $proc)
483 i32.const 16
484 call_indirect (type $proc)
485 )
486 (func $mutual-runaway1 (;54;) (type $proc)
487 i32.const 18
488 call_indirect (type $proc)
489 )
490 (func $mutual-runaway2 (;55;) (type $proc)
491 i32.const 17
492 call_indirect (type $proc)
493 )
494 (func (;56;) (type $out-i32) (result i32)
495 i32.const 0
496 call_indirect (type $out-i32)
497 i32.const 2
498 i32.const 3
499 select
500 )
501 (func (;57;) (type $out-i32) (result i32)
502 i32.const 2
503 i32.const 0
504 call_indirect (type $out-i32)
505 i32.const 3
506 select
507 )
508 (func (;58;) (type $out-i32) (result i32)
509 i32.const 2
510 i32.const 3
511 i32.const 0
512 call_indirect (type $out-i32)
513 select
514 )
515 (func (;59;) (type $out-i32) (result i32)
516 i32.const 0
517 call_indirect (type $out-i32)
518 if (result i32) ;; label = @1
519 i32.const 1
520 else
521 i32.const 2
522 end
523 )
524 (func (;60;) (type $out-i64) (result i64)
525 block (result i64) ;; label = @1
526 i32.const 1
527 call_indirect (type $out-i64)
528 i32.const 2
529 br_if 0 (;@1;)
530 end
531 )
532 (func (;61;) (type $out-i32) (result i32)
533 block (result i32) ;; label = @1
534 i32.const 2
535 i32.const 0
536 call_indirect (type $out-i32)
537 br_if 0 (;@1;)
538 end
539 )
540 (func (;62;) (type $out-f32) (result f32)
541 block (result f32) ;; label = @1
542 i32.const 2
543 call_indirect (type $out-f32)
544 i32.const 2
545 br_table 0 (;@1;) 0 (;@1;)
546 end
547 )
548 (func (;63;) (type $out-i32) (result i32)
549 block (result i32) ;; label = @1
550 i32.const 2
551 i32.const 0
552 call_indirect (type $out-i32)
553 br_table 0 (;@1;) 0 (;@1;)
554 end
555 )
556 (func (;64;) (type $proc)
557 i32.const 0
558 call_indirect (type $out-i32)
559 i32.const 1
560 i32.store
561 )
562 (func (;65;) (type $proc)
563 i32.const 10
564 i32.const 3
565 call_indirect (type $out-f64)
566 f64.store
567 )
568 (func (;66;) (type $out-i32) (result i32)
569 i32.const 0
570 call_indirect (type $out-i32)
571 memory.grow
572 )
573 (func (;67;) (type $out-i32) (result i32)
574 i32.const 1
575 i32.const 4
576 call_indirect (type $over-i32)
577 return
578 )
579 (func (;68;) (type $proc)
580 i64.const 1
581 i32.const 5
582 call_indirect (type $over-i64)
583 drop
584 )
585 (func (;69;) (type $out-f32) (result f32)
586 block (result f32) ;; label = @1
587 f32.const 0x1p+0 (;=1;)
588 i32.const 6
589 call_indirect (type $over-f32)
590 br 0 (;@1;)
591 end
592 )
593 (func (;70;) (type $out-f64) (result f64)
594 (local f64)
595 f64.const 0x1p+0 (;=1;)
596 i32.const 7
597 call_indirect (type $over-f64)
598 local.set 0
599 local.get 0
600 )
601 (func (;71;) (type $out-f64) (result f64)
602 (local f64)
603 f64.const 0x1p+0 (;=1;)
604 i32.const 7
605 call_indirect (type $over-f64)
606 local.tee 0
607 )
608 (func (;72;) (type $out-f64) (result f64)
609 f64.const 0x1p+0 (;=1;)
610 i32.const 7
611 call_indirect (type $over-f64)
612 global.set $a
613 global.get $a
614 )
615 (func (;73;) (type $out-i32) (result i32)
616 i32.const 0
617 call_indirect (type $out-i32)
618 i32.load
619 )
620 (func (;74;) (type $out-f32) (result f32)
621 block (result f32) ;; label = @1
622 f32.const 0x0p+0 (;=0;)
623 i32.const 6
624 call_indirect (type $over-f32)
625 f32.sqrt
626 end
627 )
628 (func (;75;) (type $out-i32) (result i32)
629 block (result i32) ;; label = @1
630 i32.const 1
631 i32.const 4
632 call_indirect (type $over-i32)
633 i32.const 10
634 i32.add
635 end
636 )
637 (func (;76;) (type $out-i32) (result i32)
638 block (result i32) ;; label = @1
639 i32.const 10
640 i32.const 1
641 i32.const 4
642 call_indirect (type $over-i32)
643 i32.sub
644 end
645 )
646 (func (;77;) (type $out-i32) (result i32)
647 block (result i32) ;; label = @1
648 i32.const 1
649 i32.const 4
650 call_indirect (type $over-i32)
651 i32.eqz
652 end
653 )
654 (func (;78;) (type $out-i32) (result i32)
655 block (result i32) ;; label = @1
656 i32.const 1
657 i32.const 4
658 call_indirect (type $over-i32)
659 i32.const 10
660 i32.le_u
661 end
662 )
663 (func (;79;) (type $out-i32) (result i32)
664 block (result i32) ;; label = @1
665 i32.const 10
666 i32.const 1
667 i32.const 4
668 call_indirect (type $over-i32)
669 i32.ne
670 end
671 )
672 (func (;80;) (type $out-i64) (result i64)
673 block (result i64) ;; label = @1
674 i32.const 1
675 i32.const 4
676 call_indirect (type $over-i32)
677 i64.extend_i32_s
678 end
679 )
680 )