Debian Codegraph @

tests/cli/gc/rec-group-local.wast

raw
1 ;; RUN: wast --assert default --snapshot tests/snapshots %
2
3 ;; Test that we can properly push valtypes containing rec-group-local indices
4 ;; onto the operand stack:
5 ;;
6 ;; * Once canonicalized, `$f`'s parameter reference to `$g` will be a
7 ;; rec-group-local index: `(recgroup 1)`
8 ;;
9 ;; * The `call_ref` function will push the parameter types to the validator's
10 ;; operand stack.
11 ;;
12 ;; * But we have the invariant that all type indices on the validator's operand
13 ;; stack are `CoreTypeId`s.
14 ;;
15 ;; * So, internally, we re-canonicalize these indices into `CoreTypeId`s. This
16 ;; is done by implementations of the `WasmModuleResources` trait.
17
18 (module
19 (rec (type $f (func (param (ref $g))))
20 (type $g (func)))
21
22 (func (export "run") (param (ref $f) (ref $g))
23 local.get 1
24 local.get 0
25 call_ref $f)
26 )