diff --git a/crates/wasm-smith/src/core/code_builder.rs b/crates/wasm-smith/src/core/code_builder.rs index a55c5aafda..c4cc515e32 100644 --- a/crates/wasm-smith/src/core/code_builder.rs +++ b/crates/wasm-smith/src/core/code_builder.rs @@ -1617,13 +1617,24 @@ fn try_table( let i = i as u32; let label_types = ctrl.label_types(); + + // Empty labels are candidates for a `catch_all` since nothing is + // pushed in that case. if label_types.is_empty() { catch_options.push(Box::new(move |_, _| Ok(Catch::All { label: i }))); } + + // Labels with just an `externref` are suitable for `catch_all_refs`, + // which first pushes nothing since there's no tag and then pushes + // the caught exception value. if label_types == [ValType::EXNREF] { catch_options.push(Box::new(move |_, _| Ok(Catch::AllRef { label: i }))); } + // If there is a tag which exactly matches the types of the label we're + // looking at then that tag can be used as part of a `catch` branch. + // That tag's parameters, which are the except values, are pushed + // for the label. if builder.allocs.tags.contains_key(label_types) { let label_types = label_types.to_vec(); catch_options.push(Box::new(move |u, builder| { @@ -1634,15 +1645,20 @@ fn try_table( })); } - let mut label_types_with_exnref = label_types.to_vec(); - label_types_with_exnref.push(ValType::EXNREF); - if builder.allocs.tags.contains_key(&label_types_with_exnref) { - catch_options.push(Box::new(move |u, builder| { - Ok(Catch::OneRef { - tag: *u.choose(&builder.allocs.tags[&label_types_with_exnref])?, - label: i, - }) - })); + // And finally the last type of catch label, `catch_ref`. If the label + // ends with `exnref`, then use everything except the last `exnref` to + // see if there's a matching tag. If so then `catch_ref` can be used + // with that tag when branching to this label. + if let Some((&ValType::EXNREF, rest)) = label_types.split_last() { + if builder.allocs.tags.contains_key(rest) { + let rest = rest.to_vec(); + catch_options.push(Box::new(move |u, builder| { + Ok(Catch::OneRef { + tag: *u.choose(&builder.allocs.tags[&rest])?, + label: i, + }) + })); + } } } diff --git a/crates/wasmparser/src/validator/operators.rs b/crates/wasmparser/src/validator/operators.rs index 1f1496f19a..78af86e45e 100644 --- a/crates/wasmparser/src/validator/operators.rs +++ b/crates/wasmparser/src/validator/operators.rs @@ -1473,18 +1473,20 @@ where Catch::OneRef { tag, label } => { let tag = self.tag_at(tag)?; let (ty, kind) = self.jump(label)?; - let params = tag.params().iter().copied(); - let types = self.label_types(ty, kind)?; - if params.len() + 1 != types.len() { + let tag_params = tag.params().iter().copied(); + let label_types = self.label_types(ty, kind)?; + if tag_params.len() + 1 != label_types.len() { bail!( self.offset, "type mismatch: catch_ref label must have one \ more type than tag types", ); } - for (expected, actual) in types.zip(params.chain([ValType::EXNREF])) { - self.push_operand(actual)?; - self.pop_operand(Some(expected))?; + for (expected_label_tyep, actual_tag_param) in + label_types.zip(tag_params.chain([ValType::EXNREF])) + { + self.push_operand(actual_tag_param)?; + self.pop_operand(Some(expected_label_tyep))?; } } diff --git a/crates/wasmprinter/src/lib.rs b/crates/wasmprinter/src/lib.rs index 81252c2c4a..56657ffd1e 100644 --- a/crates/wasmprinter/src/lib.rs +++ b/crates/wasmprinter/src/lib.rs @@ -779,13 +779,13 @@ impl Printer { } CompositeType::Array(ty) => { self.start_group("array"); - let r = self.print_array_type(ty)?; + let r = self.print_array_type(state, ty)?; self.end_group(); // `array` r } CompositeType::Struct(ty) => { self.start_group("struct"); - let r = self.print_struct_type(ty)?; + let r = self.print_struct_type(state, ty)?; self.end_group(); // `struct` r } @@ -864,7 +864,7 @@ impl Printer { // a new one if that's the case with a named parameter. for (i, param) in ty.params().iter().enumerate() { params.start_local(names_for.unwrap_or(u32::MAX), i as u32, self, state); - self.print_valtype(*param)?; + self.print_valtype(state, *param)?; params.end_local(&mut self.result); } params.finish(&mut self.result); @@ -872,7 +872,7 @@ impl Printer { self.result.push_str(" (result"); for result in ty.results().iter() { self.result.push(' '); - self.print_valtype(*result)?; + self.print_valtype(state, *result)?; } self.result.push(')'); } @@ -885,26 +885,26 @@ impl Printer { Ok(0) } - fn print_field_type(&mut self, ty: &FieldType) -> Result { + fn print_field_type(&mut self, state: &State, ty: &FieldType) -> Result { self.result.push(' '); if ty.mutable { self.result.push_str("(mut "); } - self.print_storage_type(ty.element_type)?; + self.print_storage_type(state, ty.element_type)?; if ty.mutable { self.result.push_str(")"); } Ok(0) } - fn print_array_type(&mut self, ty: &ArrayType) -> Result { - self.print_field_type(&ty.0) + fn print_array_type(&mut self, state: &State, ty: &ArrayType) -> Result { + self.print_field_type(state, &ty.0) } - fn print_struct_type(&mut self, ty: &StructType) -> Result { + fn print_struct_type(&mut self, state: &State, ty: &StructType) -> Result { for field in ty.fields.iter() { self.result.push_str(" (field"); - self.print_field_type(field)?; + self.print_field_type(state, field)?; self.result.push(')'); } Ok(0) @@ -922,28 +922,28 @@ impl Printer { Ok(0) } - fn print_storage_type(&mut self, ty: StorageType) -> Result<()> { + fn print_storage_type(&mut self, state: &State, ty: StorageType) -> Result<()> { match ty { StorageType::I8 => self.result.push_str("i8"), StorageType::I16 => self.result.push_str("i16"), - StorageType::Val(val_type) => self.print_valtype(val_type)?, + StorageType::Val(val_type) => self.print_valtype(state, val_type)?, } Ok(()) } - fn print_valtype(&mut self, ty: ValType) -> Result<()> { + fn print_valtype(&mut self, state: &State, ty: ValType) -> Result<()> { match ty { ValType::I32 => self.result.push_str("i32"), ValType::I64 => self.result.push_str("i64"), ValType::F32 => self.result.push_str("f32"), ValType::F64 => self.result.push_str("f64"), ValType::V128 => self.result.push_str("v128"), - ValType::Ref(rt) => self.print_reftype(rt)?, + ValType::Ref(rt) => self.print_reftype(state, rt)?, } Ok(()) } - fn print_reftype(&mut self, ty: RefType) -> Result<()> { + fn print_reftype(&mut self, state: &State, ty: RefType) -> Result<()> { if ty.is_nullable() { match ty.as_non_null() { RefType::FUNC => self.result.push_str("funcref"), @@ -959,19 +959,19 @@ impl Printer { RefType::EXN => self.result.push_str("exnref"), _ => { self.result.push_str("(ref null "); - self.print_heaptype(ty.heap_type())?; + self.print_heaptype(state, ty.heap_type())?; self.result.push_str(")"); } } } else { self.result.push_str("(ref "); - self.print_heaptype(ty.heap_type())?; + self.print_heaptype(state, ty.heap_type())?; self.result.push_str(")"); } Ok(()) } - fn print_heaptype(&mut self, ty: HeapType) -> Result<()> { + fn print_heaptype(&mut self, state: &State, ty: HeapType) -> Result<()> { match ty { HeapType::Func => self.result.push_str("func"), HeapType::Extern => self.result.push_str("extern"), @@ -986,9 +986,9 @@ impl Printer { HeapType::Cont => self.result.push_str("cont"), HeapType::NoCont => self.result.push_str("nocont"), HeapType::Exn => self.result.push_str("exn"), - HeapType::Concrete(i) => self - .result - .push_str(&format!("{}", i.as_module_index().unwrap())), + HeapType::Concrete(i) => { + self.print_idx(&state.core.type_names, i.as_module_index().unwrap())?; + } } Ok(()) } @@ -1047,7 +1047,7 @@ impl Printer { } self.print_limits(ty.initial, ty.maximum)?; self.result.push(' '); - self.print_reftype(ty.element_type)?; + self.print_reftype(state, ty.element_type)?; Ok(()) } @@ -1096,10 +1096,10 @@ impl Printer { } if ty.mutable { self.result.push_str("(mut "); - self.print_valtype(ty.content_type)?; + self.print_valtype(state, ty.content_type)?; self.result.push(')'); } else { - self.print_valtype(ty.content_type)?; + self.print_valtype(state, ty.content_type)?; } Ok(()) } @@ -1231,7 +1231,7 @@ impl Printer { first = false; } locals.start_local(func_idx, params + local_idx, self, state); - self.print_valtype(ty)?; + self.print_valtype(state, ty)?; locals.end_local(&mut self.result); local_idx += 1; } @@ -1492,7 +1492,7 @@ impl Printer { } } ElementItems::Expressions(ty, reader) => { - self.print_reftype(ty)?; + self.print_reftype(state, ty)?; for expr in reader { self.result.push(' '); self.print_const_expr_sugar(state, &expr?, "item")? @@ -1966,7 +1966,7 @@ impl Printer { self.result.push_str(" "); self.start_group("resource"); self.result.push_str(" (rep "); - self.print_valtype(rep)?; + self.print_valtype(states.last().unwrap(), rep)?; self.result.push_str(")"); if let Some(dtor) = dtor { self.result.push_str(" (dtor (func "); diff --git a/crates/wasmprinter/src/operator.rs b/crates/wasmprinter/src/operator.rs index 3b7f29949b..f232fe3934 100644 --- a/crates/wasmprinter/src/operator.rs +++ b/crates/wasmprinter/src/operator.rs @@ -87,7 +87,7 @@ impl<'a, 'b> PrintOperator<'a, 'b> { BlockType::Empty => {} BlockType::Type(t) => { self.push_str(" (result "); - self.printer.print_valtype(t)?; + self.printer.print_valtype(self.state, t)?; self.push_str(")"); } BlockType::FuncType(idx) => { @@ -257,11 +257,11 @@ impl<'a, 'b> PrintOperator<'a, 'b> { } fn from_ref_type(&mut self, ref_ty: RefType) -> Result<()> { - self.printer.print_reftype(ref_ty) + self.printer.print_reftype(self.state, ref_ty) } fn to_ref_type(&mut self, ref_ty: RefType) -> Result<()> { - self.printer.print_reftype(ref_ty) + self.printer.print_reftype(self.state, ref_ty) } fn data_index(&mut self, idx: u32) -> Result<()> { @@ -436,12 +436,12 @@ macro_rules! define_visit { ); (payload $self:ident TypedSelect $ty:ident) => ( $self.push_str(" (result "); - $self.printer.print_valtype($ty)?; + $self.printer.print_valtype($self.state, $ty)?; $self.push_str(")") ); (payload $self:ident RefNull $hty:ident) => ( $self.push_str(" "); - $self.printer.print_heaptype($hty)?; + $self.printer.print_heaptype($self.state, $hty)?; ); (payload $self:ident TableInit $segment:ident $table:ident) => ( $self.push_str(" "); @@ -549,25 +549,25 @@ macro_rules! define_visit { $self.push_str(" "); let rty = RefType::new(false, $hty) .ok_or_else(|| anyhow!("implementation limit: type index too large"))?; - $self.printer.print_reftype(rty)?; + $self.printer.print_reftype($self.state, rty)?; ); (payload $self:ident RefTestNullable $hty:ident) => ( $self.push_str(" "); let rty = RefType::new(true, $hty) .ok_or_else(|| anyhow!("implementation limit: type index too large"))?; - $self.printer.print_reftype(rty)?; + $self.printer.print_reftype($self.state, rty)?; ); (payload $self:ident RefCastNonNull $hty:ident) => ( $self.push_str(" "); let rty = RefType::new(false, $hty) .ok_or_else(|| anyhow!("implementation limit: type index too large"))?; - $self.printer.print_reftype(rty)?; + $self.printer.print_reftype($self.state, rty)?; ); (payload $self:ident RefCastNullable $hty:ident) => ( $self.push_str(" "); let rty = RefType::new(true, $hty) .ok_or_else(|| anyhow!("implementation limit: type index too large"))?; - $self.printer.print_reftype(rty)?; + $self.printer.print_reftype($self.state, rty)?; ); (payload $self:ident $op:ident $($arg:ident)*) => ( $( diff --git a/crates/wast/src/core/binary.rs b/crates/wast/src/core/binary.rs index a15fcceb17..35fb64681a 100644 --- a/crates/wast/src/core/binary.rs +++ b/crates/wast/src/core/binary.rs @@ -761,19 +761,6 @@ impl Encode for BlockType<'_> { } } -impl Encode for FuncBindType<'_> { - fn encode(&self, e: &mut Vec) { - self.ty.encode(e); - } -} - -impl Encode for LetType<'_> { - fn encode(&self, e: &mut Vec) { - self.block.encode(e); - self.locals.encode(e); - } -} - impl Encode for LaneArg { fn encode(&self, e: &mut Vec) { self.lane.encode(e); @@ -1035,8 +1022,7 @@ fn find_names<'a>( | Instruction::Loop(block) | Instruction::Try(block) | Instruction::Barrier(block) - | Instruction::TryTable(TryTable { block, .. }) - | Instruction::Let(LetType { block, .. }) => { + | Instruction::TryTable(TryTable { block, .. }) => { if let Some(name) = get_name(&block.label, &block.label_name) { label_names.push((label_idx, name)); } diff --git a/crates/wast/src/core/expr.rs b/crates/wast/src/core/expr.rs index 8f188dd50d..fa5292fa5a 100644 --- a/crates/wast/src/core/expr.rs +++ b/crates/wast/src/core/expr.rs @@ -184,7 +184,6 @@ impl<'a> ExpressionParser<'a> { // seen i @ Instruction::Block(_) | i @ Instruction::Loop(_) - | i @ Instruction::Let(_) | i @ Instruction::Barrier(_) | i @ Instruction::TryTable(_) => { self.instrs.push(i); @@ -469,8 +468,6 @@ instructions! { // function-references proposal CallRef(Index<'a>) : [0x14] : "call_ref", ReturnCallRef(Index<'a>) : [0x15] : "return_call_ref", - FuncBind(FuncBindType<'a>) : [0x16] : "func.bind", - Let(LetType<'a>) : [0x17] : "let", Drop : [0x1a] : "drop", Select(SelectTypes<'a>) : [] : "select", @@ -1283,40 +1280,6 @@ pub struct TryTableCatch<'a> { pub label: Index<'a>, } -/// Extra information associated with the func.bind instruction. -#[derive(Debug)] -#[allow(missing_docs)] -pub struct FuncBindType<'a> { - pub ty: TypeUse<'a, FunctionType<'a>>, -} - -impl<'a> Parse<'a> for FuncBindType<'a> { - fn parse(parser: Parser<'a>) -> Result { - Ok(FuncBindType { - ty: parser - .parse::>>()? - .into(), - }) - } -} - -/// Extra information associated with the let instruction. -#[derive(Debug)] -#[allow(missing_docs)] -pub struct LetType<'a> { - pub block: Box>, - pub locals: Box<[Local<'a>]>, -} - -impl<'a> Parse<'a> for LetType<'a> { - fn parse(parser: Parser<'a>) -> Result { - Ok(LetType { - block: parser.parse()?, - locals: Local::parse_remainder(parser)?.into(), - }) - } -} - /// Extra information associated with the `br_table` instruction. #[allow(missing_docs)] #[derive(Debug)] diff --git a/crates/wast/src/core/resolve/names.rs b/crates/wast/src/core/resolve/names.rs index fc37c259ef..3c46e8d65a 100644 --- a/crates/wast/src/core/resolve/names.rs +++ b/crates/wast/src/core/resolve/names.rs @@ -496,30 +496,6 @@ impl<'a, 'b> ExprResolver<'a, 'b> { self.resolver.resolve(i, Ns::Type)?; } - FuncBind(b) => { - self.resolver.resolve_type_use(&mut b.ty)?; - } - - Let(t) => { - // Resolve (ref T) in locals - for local in t.locals.iter_mut() { - self.resolver.resolve_valtype(&mut local.ty)?; - } - - // Register all locals defined in this let - let mut scope = Namespace::default(); - for local in t.locals.iter() { - scope.register(local.id, "local")?; - } - self.scopes.push(scope); - self.blocks.push(ExprBlock { - label: t.block.label, - pushed_scope: true, - }); - - self.resolve_block_type(&mut t.block)?; - } - Block(bt) | If(bt) | Loop(bt) | Try(bt) | Barrier(bt) => { self.blocks.push(ExprBlock { label: bt.label, diff --git a/crates/wast/src/core/resolve/types.rs b/crates/wast/src/core/resolve/types.rs index bc30d323eb..06cbdc6f8b 100644 --- a/crates/wast/src/core/resolve/types.rs +++ b/crates/wast/src/core/resolve/types.rs @@ -139,7 +139,6 @@ impl<'a> Expander<'a> { Instruction::Block(bt) | Instruction::If(bt) | Instruction::Loop(bt) - | Instruction::Let(LetType { block: bt, .. }) | Instruction::Try(bt) | Instruction::Barrier(bt) | Instruction::TryTable(TryTable { block: bt, .. }) => { @@ -175,9 +174,6 @@ impl<'a> Expander<'a> { } self.expand_type_use(&mut bt.ty); } - Instruction::FuncBind(b) => { - self.expand_type_use(&mut b.ty); - } Instruction::CallIndirect(c) | Instruction::ReturnCallIndirect(c) => { self.expand_type_use(&mut c.ty); } diff --git a/tests/local/function-references/let-bad.wast b/tests/local/function-references/let-bad.wast deleted file mode 100644 index 300026cd6d..0000000000 --- a/tests/local/function-references/let-bad.wast +++ /dev/null @@ -1,5 +0,0 @@ -(assert_invalid - (module - (func let) - ) - "illegal opcode: 0x17") diff --git a/tests/local/invalid-let.wast b/tests/local/invalid-let.wast deleted file mode 100644 index 657e4959a9..0000000000 --- a/tests/local/invalid-let.wast +++ /dev/null @@ -1,9 +0,0 @@ -(assert_invalid - (module - (func - let - else - else - local.get 1 - )) - "illegal opcode: 0x17") ;; update this error once wasmparser is updated diff --git a/tests/snapshots/local/function-reference-structural-matching.wat.print b/tests/snapshots/local/function-reference-structural-matching.wat.print index 515dfd6628..66ad35ef56 100644 --- a/tests/snapshots/local/function-reference-structural-matching.wat.print +++ b/tests/snapshots/local/function-reference-structural-matching.wat.print @@ -1,13 +1,13 @@ (module (type $t1 (;0;) (func)) - (type $t2_a (;1;) (func (param (ref 0) (ref 0)))) - (type $t2_b (;2;) (func (param (ref 0) (ref 0)))) - (type (;3;) (func (param (ref 1)))) - (type (;4;) (func (param (ref 2)))) - (func $f (;0;) (type 3) (param (ref 1)) + (type $t2_a (;1;) (func (param (ref $t1) (ref $t1)))) + (type $t2_b (;2;) (func (param (ref $t1) (ref $t1)))) + (type (;3;) (func (param (ref $t2_a)))) + (type (;4;) (func (param (ref $t2_b)))) + (func $f (;0;) (type 3) (param (ref $t2_a)) nop ) - (func $g (;1;) (type 4) (param (ref 2)) + (func $g (;1;) (type 4) (param (ref $t2_b)) local.get 0 call $f ) diff --git a/tests/snapshots/local/function-references/call_ref/br_on_non_null.wast/0.print b/tests/snapshots/local/function-references/call_ref/br_on_non_null.wast/0.print index 743a9579e9..06ea0e4c4f 100644 --- a/tests/snapshots/local/function-references/call_ref/br_on_non_null.wast/0.print +++ b/tests/snapshots/local/function-references/call_ref/br_on_non_null.wast/0.print @@ -1,9 +1,9 @@ (module (type $t (;0;) (func (result i32))) - (type (;1;) (func (param (ref 0)) (result i32))) - (type (;2;) (func (param (ref null 0)) (result i32))) - (func $nn (;0;) (type 1) (param $r (ref 0)) (result i32) - block $l (result (ref 0)) + (type (;1;) (func (param (ref $t)) (result i32))) + (type (;2;) (func (param (ref null $t)) (result i32))) + (func $nn (;0;) (type 1) (param $r (ref $t)) (result i32) + block $l (result (ref $t)) local.get $r br_on_non_null $l i32.const -1 @@ -11,8 +11,8 @@ end call_ref $t ) - (func $n (;1;) (type 2) (param $r (ref null 0)) (result i32) - block $l (result (ref 0)) + (func $n (;1;) (type 2) (param $r (ref null $t)) (result i32) + block $l (result (ref $t)) local.get $r br_on_non_null $l i32.const -1 @@ -24,7 +24,7 @@ i32.const 7 ) (func (;3;) (type $t) (result i32) - ref.null 0 + ref.null $t call $n ) (func (;4;) (type $t) (result i32) diff --git a/tests/snapshots/local/function-references/call_ref/br_on_non_null.wast/5.print b/tests/snapshots/local/function-references/call_ref/br_on_non_null.wast/5.print index 08dc0edf52..bea13444c9 100644 --- a/tests/snapshots/local/function-references/call_ref/br_on_non_null.wast/5.print +++ b/tests/snapshots/local/function-references/call_ref/br_on_non_null.wast/5.print @@ -1,10 +1,10 @@ (module (type $t (;0;) (func)) - (type (;1;) (func (param (ref null 0)))) + (type (;1;) (func (param (ref null $t)))) (type (;2;) (func (param funcref))) (type (;3;) (func (param externref))) - (func (;0;) (type 1) (param $r (ref null 0)) - block (result (ref 0)) ;; label = @1 + (func (;0;) (type 1) (param $r (ref null $t)) + block (result (ref $t)) ;; label = @1 local.get $r br_on_non_null 0 (;@1;) unreachable diff --git a/tests/snapshots/local/function-references/call_ref/br_on_non_null.wast/6.print b/tests/snapshots/local/function-references/call_ref/br_on_non_null.wast/6.print index a0185721b8..fd25db678c 100644 --- a/tests/snapshots/local/function-references/call_ref/br_on_non_null.wast/6.print +++ b/tests/snapshots/local/function-references/call_ref/br_on_non_null.wast/6.print @@ -1,14 +1,14 @@ (module (type $t (;0;) (func (param i32) (result i32))) - (type (;1;) (func (param i32 (ref null 0)) (result i32))) - (type (;2;) (func (result i32 (ref 0)))) + (type (;1;) (func (param i32 (ref null $t)) (result i32))) + (type (;2;) (func (result i32 (ref $t)))) (func $f (;0;) (type $t) (param i32) (result i32) local.get 0 local.get 0 i32.mul ) - (func $a (;1;) (type 1) (param $n i32) (param $r (ref null 0)) (result i32) - block $l (type 2) (result i32 (ref 0)) + (func $a (;1;) (type 1) (param $n i32) (param $r (ref null $t)) (result i32) + block $l (type 2) (result i32 (ref $t)) local.get $n local.get $r br_on_non_null $l @@ -18,7 +18,7 @@ ) (func (;2;) (type $t) (param $n i32) (result i32) local.get $n - ref.null 0 + ref.null $t call $a ) (func (;3;) (type $t) (param $n i32) (result i32) diff --git a/tests/snapshots/local/function-references/call_ref/br_on_null.wast/0.print b/tests/snapshots/local/function-references/call_ref/br_on_null.wast/0.print index 0aa70467fb..be60e9af88 100644 --- a/tests/snapshots/local/function-references/call_ref/br_on_null.wast/0.print +++ b/tests/snapshots/local/function-references/call_ref/br_on_null.wast/0.print @@ -1,8 +1,8 @@ (module (type $t (;0;) (func (result i32))) - (type (;1;) (func (param (ref 0)) (result i32))) - (type (;2;) (func (param (ref null 0)) (result i32))) - (func $nn (;0;) (type 1) (param $r (ref 0)) (result i32) + (type (;1;) (func (param (ref $t)) (result i32))) + (type (;2;) (func (param (ref null $t)) (result i32))) + (func $nn (;0;) (type 1) (param $r (ref $t)) (result i32) block $l local.get $r br_on_null $l @@ -11,7 +11,7 @@ end i32.const -1 ) - (func $n (;1;) (type 2) (param $r (ref null 0)) (result i32) + (func $n (;1;) (type 2) (param $r (ref null $t)) (result i32) block $l local.get $r br_on_null $l @@ -24,7 +24,7 @@ i32.const 7 ) (func (;3;) (type $t) (result i32) - ref.null 0 + ref.null $t call $n ) (func (;4;) (type $t) (result i32) diff --git a/tests/snapshots/local/function-references/call_ref/br_on_null.wast/5.print b/tests/snapshots/local/function-references/call_ref/br_on_null.wast/5.print index f7ecabad1a..1946ceaca1 100644 --- a/tests/snapshots/local/function-references/call_ref/br_on_null.wast/5.print +++ b/tests/snapshots/local/function-references/call_ref/br_on_null.wast/5.print @@ -1,9 +1,9 @@ (module (type $t (;0;) (func)) - (type (;1;) (func (param (ref null 0)))) + (type (;1;) (func (param (ref null $t)))) (type (;2;) (func (param funcref))) (type (;3;) (func (param externref))) - (func (;0;) (type 1) (param $r (ref null 0)) + (func (;0;) (type 1) (param $r (ref null $t)) local.get $r br_on_null 0 (;@0;) drop diff --git a/tests/snapshots/local/function-references/call_ref/br_on_null.wast/6.print b/tests/snapshots/local/function-references/call_ref/br_on_null.wast/6.print index 4059e9ee4d..ffab737fcf 100644 --- a/tests/snapshots/local/function-references/call_ref/br_on_null.wast/6.print +++ b/tests/snapshots/local/function-references/call_ref/br_on_null.wast/6.print @@ -1,12 +1,12 @@ (module (type $t (;0;) (func (param i32) (result i32))) - (type (;1;) (func (param i32 (ref null 0)) (result i32))) + (type (;1;) (func (param i32 (ref null $t)) (result i32))) (func $f (;0;) (type $t) (param i32) (result i32) local.get 0 local.get 0 i32.mul ) - (func $a (;1;) (type 1) (param $n i32) (param $r (ref null 0)) (result i32) + (func $a (;1;) (type 1) (param $n i32) (param $r (ref null $t)) (result i32) block $l (result i32) local.get $n local.get $r @@ -17,7 +17,7 @@ ) (func (;2;) (type $t) (param $n i32) (result i32) local.get $n - ref.null 0 + ref.null $t call $a ) (func (;3;) (type $t) (param $n i32) (result i32) diff --git a/tests/snapshots/local/function-references/call_ref/call_ref.wast/0.print b/tests/snapshots/local/function-references/call_ref/call_ref.wast/0.print index 620d08529b..b983464ae1 100644 --- a/tests/snapshots/local/function-references/call_ref/call_ref.wast/0.print +++ b/tests/snapshots/local/function-references/call_ref/call_ref.wast/0.print @@ -2,9 +2,9 @@ (type $ii (;0;) (func (param i32) (result i32))) (type $ll (;1;) (func (param i64) (result i64))) (type $lll (;2;) (func (param i64 i64) (result i64))) - (type (;3;) (func (param (ref 0) i32) (result i32))) + (type (;3;) (func (param (ref $ii) i32) (result i32))) (type (;4;) (func (result i32))) - (func $apply (;0;) (type 3) (param $f (ref 0)) (param $x i32) (result i32) + (func $apply (;0;) (type 3) (param $f (ref $ii)) (param $x i32) (result i32) local.get $x local.get $f call_ref $ii @@ -20,7 +20,7 @@ i32.sub ) (func (;3;) (type $ii) (param $x i32) (result i32) - (local $rf (ref null 0)) (local $rg (ref null 0)) + (local $rf (ref null $ii)) (local $rg (ref null $ii)) ref.func $f local.set $rf ref.func $g @@ -33,7 +33,7 @@ ) (func (;4;) (type 4) (result i32) i32.const 1 - ref.null 0 + ref.null $ii call_ref $ii ) (func $fac (;5;) (type $ll) (param i64) (result i64) @@ -113,11 +113,11 @@ call_ref $ll end ) - (global $fac (;0;) (ref 1) ref.func $fac) - (global $fac-acc (;1;) (ref 2) ref.func $fac-acc) - (global $fib (;2;) (ref 1) ref.func $fib) - (global $even (;3;) (ref 1) ref.func $even) - (global $odd (;4;) (ref 1) ref.func $odd) + (global $fac (;0;) (ref $ll) ref.func $fac) + (global $fac-acc (;1;) (ref $lll) ref.func $fac-acc) + (global $fib (;2;) (ref $ll) ref.func $fib) + (global $even (;3;) (ref $ll) ref.func $even) + (global $odd (;4;) (ref $ll) ref.func $odd) (export "run" (func 3)) (export "null" (func 4)) (export "fac" (func $fac)) diff --git a/tests/snapshots/local/function-references/call_ref/ref_as_non_null.wast/0.print b/tests/snapshots/local/function-references/call_ref/ref_as_non_null.wast/0.print index e874215a89..d4861f7951 100644 --- a/tests/snapshots/local/function-references/call_ref/ref_as_non_null.wast/0.print +++ b/tests/snapshots/local/function-references/call_ref/ref_as_non_null.wast/0.print @@ -1,13 +1,13 @@ (module (type $t (;0;) (func (result i32))) - (type (;1;) (func (param (ref 0)) (result i32))) - (type (;2;) (func (param (ref null 0)) (result i32))) - (func $nn (;0;) (type 1) (param $r (ref 0)) (result i32) + (type (;1;) (func (param (ref $t)) (result i32))) + (type (;2;) (func (param (ref null $t)) (result i32))) + (func $nn (;0;) (type 1) (param $r (ref $t)) (result i32) local.get $r ref.as_non_null call_ref $t ) - (func $n (;1;) (type 2) (param $r (ref null 0)) (result i32) + (func $n (;1;) (type 2) (param $r (ref null $t)) (result i32) local.get $r ref.as_non_null call_ref $t @@ -16,7 +16,7 @@ i32.const 7 ) (func (;3;) (type $t) (result i32) - ref.null 0 + ref.null $t call $n ) (func (;4;) (type $t) (result i32) diff --git a/tests/snapshots/local/function-references/call_ref/ref_as_non_null.wast/6.print b/tests/snapshots/local/function-references/call_ref/ref_as_non_null.wast/6.print index c2f8267b27..43c84a2099 100644 --- a/tests/snapshots/local/function-references/call_ref/ref_as_non_null.wast/6.print +++ b/tests/snapshots/local/function-references/call_ref/ref_as_non_null.wast/6.print @@ -1,9 +1,9 @@ (module (type $t (;0;) (func)) - (type (;1;) (func (param (ref 0)))) + (type (;1;) (func (param (ref $t)))) (type (;2;) (func (param (ref func)))) (type (;3;) (func (param (ref extern)))) - (func (;0;) (type 1) (param $r (ref 0)) + (func (;0;) (type 1) (param $r (ref $t)) local.get $r ref.as_non_null drop diff --git a/tests/snapshots/local/function-references/call_ref/return_call_ref.wast/0.print b/tests/snapshots/local/function-references/call_ref/return_call_ref.wast/0.print index 2e35173950..451693d9de 100644 --- a/tests/snapshots/local/function-references/call_ref/return_call_ref.wast/0.print +++ b/tests/snapshots/local/function-references/call_ref/return_call_ref.wast/0.print @@ -110,7 +110,7 @@ return_call_ref $i64-f64 ) (func (;24;) (type $proc) - ref.null 0 + ref.null $proc return_call_ref $proc ) (func $fac-acc (;25;) (type $i64i64-i64) (param i64 i64) (result i64) @@ -168,22 +168,22 @@ return_call_ref $i64-i64 end ) - (global $const-i32 (;0;) (ref 1) ref.func $const-i32) - (global $const-i64 (;1;) (ref 2) ref.func $const-i64) - (global $const-f32 (;2;) (ref 3) ref.func $const-f32) - (global $const-f64 (;3;) (ref 4) ref.func $const-f64) - (global $id-i32 (;4;) (ref 5) ref.func $id-i32) - (global $id-i64 (;5;) (ref 6) ref.func $id-i64) - (global $id-f32 (;6;) (ref 7) ref.func $id-f32) - (global $id-f64 (;7;) (ref 8) ref.func $id-f64) - (global $f32-i32 (;8;) (ref 9) ref.func $f32-i32) - (global $i32-i64 (;9;) (ref 10) ref.func $i32-i64) - (global $f64-f32 (;10;) (ref 11) ref.func $f64-f32) - (global $i64-f64 (;11;) (ref 12) ref.func $i64-f64) - (global $fac-acc (;12;) (ref 13) ref.func $fac-acc) - (global $count (;13;) (ref 6) ref.func $count) - (global $even (;14;) (ref 6) ref.func $even) - (global $odd (;15;) (ref 6) ref.func $odd) + (global $const-i32 (;0;) (ref $-i32) ref.func $const-i32) + (global $const-i64 (;1;) (ref $-i64) ref.func $const-i64) + (global $const-f32 (;2;) (ref $-f32) ref.func $const-f32) + (global $const-f64 (;3;) (ref $-f64) ref.func $const-f64) + (global $id-i32 (;4;) (ref $i32-i32) ref.func $id-i32) + (global $id-i64 (;5;) (ref $i64-i64) ref.func $id-i64) + (global $id-f32 (;6;) (ref $f32-f32) ref.func $id-f32) + (global $id-f64 (;7;) (ref $f64-f64) ref.func $id-f64) + (global $f32-i32 (;8;) (ref $f32-i32) ref.func $f32-i32) + (global $i32-i64 (;9;) (ref $i32-i64) ref.func $i32-i64) + (global $f64-f32 (;10;) (ref $f64-f32) ref.func $f64-f32) + (global $i64-f64 (;11;) (ref $i64-f64) ref.func $i64-f64) + (global $fac-acc (;12;) (ref $i64i64-i64) ref.func $fac-acc) + (global $count (;13;) (ref $i64-i64) ref.func $count) + (global $even (;14;) (ref $i64-i64) ref.func $even) + (global $odd (;15;) (ref $i64-i64) ref.func $odd) (export "type-i32" (func 12)) (export "type-i64" (func 13)) (export "type-f32" (func 14)) diff --git a/tests/snapshots/local/function-references/call_ref/return_call_ref.wast/33.print b/tests/snapshots/local/function-references/call_ref/return_call_ref.wast/33.print index 086c98c8b5..11dc25a989 100644 --- a/tests/snapshots/local/function-references/call_ref/return_call_ref.wast/33.print +++ b/tests/snapshots/local/function-references/call_ref/return_call_ref.wast/33.print @@ -1,18 +1,18 @@ (module (type $t (;0;) (func)) - (type $t1 (;1;) (func (result (ref 0)))) - (type $t2 (;2;) (func (result (ref null 0)))) + (type $t1 (;1;) (func (result (ref $t)))) + (type $t2 (;2;) (func (result (ref null $t)))) (type $t3 (;3;) (func (result (ref func)))) (type $t4 (;4;) (func (result funcref))) - (func $f11 (;0;) (type $t1) (result (ref 0)) + (func $f11 (;0;) (type $t1) (result (ref $t)) ref.func $f11 return_call_ref $t1 ) - (func $f21 (;1;) (type $t2) (result (ref null 0)) + (func $f21 (;1;) (type $t2) (result (ref null $t)) ref.func $f11 return_call_ref $t1 ) - (func $f22 (;2;) (type $t2) (result (ref null 0)) + (func $f22 (;2;) (type $t2) (result (ref null $t)) ref.func $f22 return_call_ref $t2 ) diff --git a/tests/snapshots/local/function-references/issue-923.wat.print b/tests/snapshots/local/function-references/issue-923.wat.print index da1954786a..ae83bebaed 100644 --- a/tests/snapshots/local/function-references/issue-923.wat.print +++ b/tests/snapshots/local/function-references/issue-923.wat.print @@ -1,74 +1,74 @@ (module (type $s0 (;0;) (func)) - (type $s1 (;1;) (func (param (ref 0) (ref 0)))) - (type $s2 (;2;) (func (param (ref 1) (ref 1)))) - (type $s3 (;3;) (func (param (ref 2) (ref 2)))) - (type $s4 (;4;) (func (param (ref 3) (ref 3)))) - (type $s5 (;5;) (func (param (ref 4) (ref 4)))) - (type $s6 (;6;) (func (param (ref 5) (ref 5)))) - (type $s7 (;7;) (func (param (ref 6) (ref 6)))) - (type $s8 (;8;) (func (param (ref 7) (ref 7)))) - (type $s9 (;9;) (func (param (ref 8) (ref 8)))) - (type $s10 (;10;) (func (param (ref 9) (ref 9)))) - (type $s11 (;11;) (func (param (ref 10) (ref 10)))) - (type $s12 (;12;) (func (param (ref 11) (ref 11)))) - (type $s13 (;13;) (func (param (ref 12) (ref 12)))) - (type $s14 (;14;) (func (param (ref 13) (ref 13)))) - (type $s15 (;15;) (func (param (ref 14) (ref 14)))) - (type $s16 (;16;) (func (param (ref 15) (ref 15)))) - (type $s17 (;17;) (func (param (ref 16) (ref 16)))) - (type $s18 (;18;) (func (param (ref 17) (ref 17)))) - (type $s19 (;19;) (func (param (ref 18) (ref 18)))) - (type $s20 (;20;) (func (param (ref 19) (ref 19)))) - (type $s21 (;21;) (func (param (ref 20) (ref 20)))) - (type $s22 (;22;) (func (param (ref 21) (ref 21)))) - (type $s23 (;23;) (func (param (ref 22) (ref 22)))) - (type $s24 (;24;) (func (param (ref 23) (ref 23)))) - (type $s25 (;25;) (func (param (ref 24) (ref 24)))) - (type $s26 (;26;) (func (param (ref 25) (ref 25)))) - (type $s27 (;27;) (func (param (ref 26) (ref 26)))) - (type $s28 (;28;) (func (param (ref 27) (ref 27)))) - (type $s29 (;29;) (func (param (ref 28) (ref 28)))) - (type $s30 (;30;) (func (param (ref 29) (ref 29)))) - (type $s31 (;31;) (func (param (ref 30) (ref 30)))) + (type $s1 (;1;) (func (param (ref $s0) (ref $s0)))) + (type $s2 (;2;) (func (param (ref $s1) (ref $s1)))) + (type $s3 (;3;) (func (param (ref $s2) (ref $s2)))) + (type $s4 (;4;) (func (param (ref $s3) (ref $s3)))) + (type $s5 (;5;) (func (param (ref $s4) (ref $s4)))) + (type $s6 (;6;) (func (param (ref $s5) (ref $s5)))) + (type $s7 (;7;) (func (param (ref $s6) (ref $s6)))) + (type $s8 (;8;) (func (param (ref $s7) (ref $s7)))) + (type $s9 (;9;) (func (param (ref $s8) (ref $s8)))) + (type $s10 (;10;) (func (param (ref $s9) (ref $s9)))) + (type $s11 (;11;) (func (param (ref $s10) (ref $s10)))) + (type $s12 (;12;) (func (param (ref $s11) (ref $s11)))) + (type $s13 (;13;) (func (param (ref $s12) (ref $s12)))) + (type $s14 (;14;) (func (param (ref $s13) (ref $s13)))) + (type $s15 (;15;) (func (param (ref $s14) (ref $s14)))) + (type $s16 (;16;) (func (param (ref $s15) (ref $s15)))) + (type $s17 (;17;) (func (param (ref $s16) (ref $s16)))) + (type $s18 (;18;) (func (param (ref $s17) (ref $s17)))) + (type $s19 (;19;) (func (param (ref $s18) (ref $s18)))) + (type $s20 (;20;) (func (param (ref $s19) (ref $s19)))) + (type $s21 (;21;) (func (param (ref $s20) (ref $s20)))) + (type $s22 (;22;) (func (param (ref $s21) (ref $s21)))) + (type $s23 (;23;) (func (param (ref $s22) (ref $s22)))) + (type $s24 (;24;) (func (param (ref $s23) (ref $s23)))) + (type $s25 (;25;) (func (param (ref $s24) (ref $s24)))) + (type $s26 (;26;) (func (param (ref $s25) (ref $s25)))) + (type $s27 (;27;) (func (param (ref $s26) (ref $s26)))) + (type $s28 (;28;) (func (param (ref $s27) (ref $s27)))) + (type $s29 (;29;) (func (param (ref $s28) (ref $s28)))) + (type $s30 (;30;) (func (param (ref $s29) (ref $s29)))) + (type $s31 (;31;) (func (param (ref $s30) (ref $s30)))) (type $t0 (;32;) (func)) - (type $t1 (;33;) (func (param (ref 32) (ref 32)))) - (type $t2 (;34;) (func (param (ref 33) (ref 33)))) - (type $t3 (;35;) (func (param (ref 34) (ref 34)))) - (type $t4 (;36;) (func (param (ref 35) (ref 35)))) - (type $t5 (;37;) (func (param (ref 36) (ref 36)))) - (type $t6 (;38;) (func (param (ref 37) (ref 37)))) - (type $t7 (;39;) (func (param (ref 38) (ref 38)))) - (type $t8 (;40;) (func (param (ref 39) (ref 39)))) - (type $t9 (;41;) (func (param (ref 40) (ref 40)))) - (type $t10 (;42;) (func (param (ref 41) (ref 41)))) - (type $t11 (;43;) (func (param (ref 42) (ref 42)))) - (type $t12 (;44;) (func (param (ref 43) (ref 43)))) - (type $t13 (;45;) (func (param (ref 44) (ref 44)))) - (type $t14 (;46;) (func (param (ref 45) (ref 45)))) - (type $t15 (;47;) (func (param (ref 46) (ref 46)))) - (type $t16 (;48;) (func (param (ref 47) (ref 47)))) - (type $t17 (;49;) (func (param (ref 48) (ref 48)))) - (type $t18 (;50;) (func (param (ref 49) (ref 49)))) - (type $t19 (;51;) (func (param (ref 50) (ref 50)))) - (type $t20 (;52;) (func (param (ref 51) (ref 51)))) - (type $t21 (;53;) (func (param (ref 52) (ref 52)))) - (type $t22 (;54;) (func (param (ref 53) (ref 53)))) - (type $t23 (;55;) (func (param (ref 54) (ref 54)))) - (type $t24 (;56;) (func (param (ref 55) (ref 55)))) - (type $t25 (;57;) (func (param (ref 56) (ref 56)))) - (type $t26 (;58;) (func (param (ref 57) (ref 57)))) - (type $t27 (;59;) (func (param (ref 58) (ref 58)))) - (type $t28 (;60;) (func (param (ref 59) (ref 59)))) - (type $t29 (;61;) (func (param (ref 60) (ref 60)))) - (type $t30 (;62;) (func (param (ref 61) (ref 61)))) - (type $t31 (;63;) (func (param (ref 62) (ref 62)))) - (type (;64;) (func (param (ref 31)))) - (type (;65;) (func (param (ref 63)))) - (func $f (;0;) (type 64) (param (ref 31)) + (type $t1 (;33;) (func (param (ref $t0) (ref $t0)))) + (type $t2 (;34;) (func (param (ref $t1) (ref $t1)))) + (type $t3 (;35;) (func (param (ref $t2) (ref $t2)))) + (type $t4 (;36;) (func (param (ref $t3) (ref $t3)))) + (type $t5 (;37;) (func (param (ref $t4) (ref $t4)))) + (type $t6 (;38;) (func (param (ref $t5) (ref $t5)))) + (type $t7 (;39;) (func (param (ref $t6) (ref $t6)))) + (type $t8 (;40;) (func (param (ref $t7) (ref $t7)))) + (type $t9 (;41;) (func (param (ref $t8) (ref $t8)))) + (type $t10 (;42;) (func (param (ref $t9) (ref $t9)))) + (type $t11 (;43;) (func (param (ref $t10) (ref $t10)))) + (type $t12 (;44;) (func (param (ref $t11) (ref $t11)))) + (type $t13 (;45;) (func (param (ref $t12) (ref $t12)))) + (type $t14 (;46;) (func (param (ref $t13) (ref $t13)))) + (type $t15 (;47;) (func (param (ref $t14) (ref $t14)))) + (type $t16 (;48;) (func (param (ref $t15) (ref $t15)))) + (type $t17 (;49;) (func (param (ref $t16) (ref $t16)))) + (type $t18 (;50;) (func (param (ref $t17) (ref $t17)))) + (type $t19 (;51;) (func (param (ref $t18) (ref $t18)))) + (type $t20 (;52;) (func (param (ref $t19) (ref $t19)))) + (type $t21 (;53;) (func (param (ref $t20) (ref $t20)))) + (type $t22 (;54;) (func (param (ref $t21) (ref $t21)))) + (type $t23 (;55;) (func (param (ref $t22) (ref $t22)))) + (type $t24 (;56;) (func (param (ref $t23) (ref $t23)))) + (type $t25 (;57;) (func (param (ref $t24) (ref $t24)))) + (type $t26 (;58;) (func (param (ref $t25) (ref $t25)))) + (type $t27 (;59;) (func (param (ref $t26) (ref $t26)))) + (type $t28 (;60;) (func (param (ref $t27) (ref $t27)))) + (type $t29 (;61;) (func (param (ref $t28) (ref $t28)))) + (type $t30 (;62;) (func (param (ref $t29) (ref $t29)))) + (type $t31 (;63;) (func (param (ref $t30) (ref $t30)))) + (type (;64;) (func (param (ref $s31)))) + (type (;65;) (func (param (ref $t31)))) + (func $f (;0;) (type 64) (param (ref $s31)) nop ) - (func $g (;1;) (type 65) (param (ref 63)) + (func $g (;1;) (type 65) (param (ref $t31)) local.get 0 call $f ) diff --git a/tests/snapshots/local/function-references/table-nonnull.wast/0.print b/tests/snapshots/local/function-references/table-nonnull.wast/0.print index b4dba63fdc..b181fafad5 100644 --- a/tests/snapshots/local/function-references/table-nonnull.wast/0.print +++ b/tests/snapshots/local/function-references/table-nonnull.wast/0.print @@ -16,7 +16,7 @@ ) (table $t1 (;0;) 10 funcref) (table $t2 (;1;) 10 funcref ref.func $dummy) - (table $t3 (;2;) 10 (ref 0) ref.func $dummy) + (table $t3 (;2;) 10 (ref $dummy) ref.func $dummy) (table $t4 (;3;) 10 (ref func) ref.func $dummy) (export "get1" (func 1)) (export "get2" (func 2)) diff --git a/tests/snapshots/local/gc/gc-array-types.wat.print b/tests/snapshots/local/gc/gc-array-types.wat.print index 9475273f30..a0a4b32a54 100644 --- a/tests/snapshots/local/gc/gc-array-types.wat.print +++ b/tests/snapshots/local/gc/gc-array-types.wat.print @@ -1,7 +1,7 @@ (module (type $a (;0;) (array i32)) (type $b (;1;) (array (mut i32))) - (type $c (;2;) (array (mut (ref null 1)))) + (type $c (;2;) (array (mut (ref null $b)))) (type $d (;3;) (array i8)) (type $e (;4;) (array (mut i16))) ) diff --git a/tests/snapshots/local/gc/gc-array.wat.print b/tests/snapshots/local/gc/gc-array.wat.print index 745396bfa8..d95dba7643 100644 --- a/tests/snapshots/local/gc/gc-array.wat.print +++ b/tests/snapshots/local/gc/gc-array.wat.print @@ -3,9 +3,9 @@ (type $b (;1;) (array (mut i32))) (type $c (;2;) (array (mut funcref))) (type (;3;) (func)) - (type (;4;) (func (param (ref 0) (ref 1)))) + (type (;4;) (func (param (ref $a) (ref $b)))) (func $func (;0;) (type 3)) - (func (;1;) (type 4) (param (ref 0) (ref 1)) + (func (;1;) (type 4) (param (ref $a) (ref $b)) i32.const 1 i32.const 1 array.new $a diff --git a/tests/snapshots/local/gc/gc-rec-sub.wat.print b/tests/snapshots/local/gc/gc-rec-sub.wat.print index 1cd788960b..784ff3562e 100644 --- a/tests/snapshots/local/gc/gc-rec-sub.wat.print +++ b/tests/snapshots/local/gc/gc-rec-sub.wat.print @@ -37,8 +37,8 @@ ) (type (;16;) (sub $a (func))) (rec - (type $t1 (;17;) (struct (field (ref 18)))) - (type $t2 (;18;) (sub (struct (field (ref 17))))) + (type $t1 (;17;) (struct (field (ref $t2)))) + (type $t2 (;18;) (sub (struct (field (ref $t1))))) ) (rec) ) diff --git a/tests/snapshots/local/gc/gc-ref-global-import.wat.print b/tests/snapshots/local/gc/gc-ref-global-import.wat.print index 4627167b1c..3805e3090c 100644 --- a/tests/snapshots/local/gc/gc-ref-global-import.wat.print +++ b/tests/snapshots/local/gc/gc-ref-global-import.wat.print @@ -1,4 +1,4 @@ (module (type $a (;0;) (struct)) - (import "" "" (global (;0;) (ref 0))) + (import "" "" (global (;0;) (ref $a))) ) diff --git a/tests/snapshots/local/gc/gc-ref.wat.print b/tests/snapshots/local/gc/gc-ref.wat.print index 4e6d85854a..3d8eea3dee 100644 --- a/tests/snapshots/local/gc/gc-ref.wat.print +++ b/tests/snapshots/local/gc/gc-ref.wat.print @@ -1,74 +1,74 @@ (module (type $a (;0;) (struct)) (type $b (;1;) (struct)) - (type $f1 (;2;) (func (param (ref 0)))) - (type $f2 (;3;) (func (result (ref 1)))) - (type (;4;) (func (param (ref 0)))) - (type (;5;) (func (result (ref 0)))) + (type $f1 (;2;) (func (param (ref $a)))) + (type $f2 (;3;) (func (result (ref $b)))) + (type (;4;) (func (param (ref $a)))) + (type (;5;) (func (result (ref $a)))) (type (;6;) (func)) - (func (;0;) (type $f1) (param (ref 0))) - (func (;1;) (type 4) (param (ref 0))) - (func (;2;) (type $f1) (param (ref 0))) - (func (;3;) (type $f1) (param (ref 0))) - (func (;4;) (type 5) (result (ref 0)) + (func (;0;) (type $f1) (param (ref $a))) + (func (;1;) (type 4) (param (ref $a))) + (func (;2;) (type $f1) (param (ref $a))) + (func (;3;) (type $f1) (param (ref $a))) + (func (;4;) (type 5) (result (ref $a)) unreachable ) (func (;5;) (type 6) - (local (ref 0)) + (local (ref $a)) ) (func (;6;) (type 6) unreachable unreachable i32.const 0 - select (result (ref 0)) - block (type $f1) (param (ref 0)) ;; label = @1 + select (result (ref $a)) + block (type $f1) (param (ref $a)) ;; label = @1 unreachable end - block (result (ref 1)) ;; label = @1 + block (result (ref $b)) ;; label = @1 unreachable end - block $f1 (type $f1) (param (ref 0)) + block $f1 (type $f1) (param (ref $a)) unreachable end - block $f2 (result (ref 1)) + block $f2 (result (ref $b)) unreachable end - loop (type $f1) (param (ref 0)) ;; label = @1 + loop (type $f1) (param (ref $a)) ;; label = @1 unreachable end - loop (result (ref 1)) ;; label = @1 + loop (result (ref $b)) ;; label = @1 unreachable end - loop $f1 (type $f1) (param (ref 0)) + loop $f1 (type $f1) (param (ref $a)) unreachable end - loop $f2 (result (ref 1)) + loop $f2 (result (ref $b)) unreachable end drop - if (type $f1) (param (ref 0)) ;; label = @1 + if (type $f1) (param (ref $a)) ;; label = @1 unreachable else unreachable end - if (result (ref 1)) ;; label = @1 + if (result (ref $b)) ;; label = @1 unreachable else unreachable end drop - if $f1 (type $f1) (param (ref 0)) + if $f1 (type $f1) (param (ref $a)) unreachable else unreachable end - if $f2 (result (ref 1)) + if $f2 (result (ref $b)) unreachable else unreachable end drop ) - (global (;0;) (ref null 0) ref.null 0) - (global (;1;) (ref null 1) ref.null 1) + (global (;0;) (ref null $a) ref.null $a) + (global (;1;) (ref null $b) ref.null $b) ) diff --git a/tests/snapshots/local/gc/gc-struct-types.wat.print b/tests/snapshots/local/gc/gc-struct-types.wat.print index b8f0171d3b..b422ed871d 100644 --- a/tests/snapshots/local/gc/gc-struct-types.wat.print +++ b/tests/snapshots/local/gc/gc-struct-types.wat.print @@ -15,7 +15,7 @@ (type (;13;) (struct (field (mut i32)) (field i32))) (type (;14;) (struct (field (mut i32)) (field (mut i32)))) (type (;15;) (struct (field i32) (field f32) (field f32) (field f32))) - (type (;16;) (struct (field i32) (field (ref null 6)) (field (mut (ref null 7))))) - (type (;17;) (struct (field i32) (field (ref null 6)) (field (mut (ref null 7))))) + (type (;16;) (struct (field i32) (field (ref null $a)) (field (mut (ref null $b))))) + (type (;17;) (struct (field i32) (field (ref null $a)) (field (mut (ref null $b))))) (type (;18;) (struct (field i32) (field i64) (field i8) (field i31ref) (field anyref))) ) diff --git a/tests/snapshots/local/gc/gc-struct.wat.print b/tests/snapshots/local/gc/gc-struct.wat.print index f856bc4e90..afcde0428c 100644 --- a/tests/snapshots/local/gc/gc-struct.wat.print +++ b/tests/snapshots/local/gc/gc-struct.wat.print @@ -9,8 +9,8 @@ (type $b (;7;) (struct (field (mut f32)))) (type (;8;) (struct (field externref))) (type (;9;) (struct (field externref) (field funcref))) - (type (;10;) (func (param (ref 6) (ref 7)))) - (func (;0;) (type 10) (param (ref 6) (ref 7)) + (type (;10;) (func (param (ref $a) (ref $b)))) + (func (;0;) (type 10) (param (ref $a) (ref $b)) f32.const 0x1p+0 (;=1;) struct.new $a drop diff --git a/tests/snapshots/local/gc/gc-subtypes.wat.print b/tests/snapshots/local/gc/gc-subtypes.wat.print index 1066b3bf06..46f3569a3c 100644 --- a/tests/snapshots/local/gc/gc-subtypes.wat.print +++ b/tests/snapshots/local/gc/gc-subtypes.wat.print @@ -4,13 +4,13 @@ (type $c (;2;) (sub $b (func))) (type $b1 (;3;) (sub final $a (func))) (type $d (;4;) (sub (struct))) - (type $e (;5;) (sub $d (struct (field (mut (ref null 4)))))) - (type $f (;6;) (sub final $e (struct (field (ref 5))))) - (type $g (;7;) (sub (func (param (ref 5)) (result (ref 5))))) - (type $h (;8;) (sub $g (func (param (ref 4)) (result (ref 6))))) - (type $j (;9;) (sub (func (param (ref 1)) (result (ref 1))))) - (type $k (;10;) (sub $j (func (param (ref 0)) (result (ref 2))))) - (type $l (;11;) (sub $j (func (param (ref 1)) (result (ref 1))))) + (type $e (;5;) (sub $d (struct (field (mut (ref null $d)))))) + (type $f (;6;) (sub final $e (struct (field (ref $e))))) + (type $g (;7;) (sub (func (param (ref $e)) (result (ref $e))))) + (type $h (;8;) (sub $g (func (param (ref $d)) (result (ref $f))))) + (type $j (;9;) (sub (func (param (ref $b)) (result (ref $b))))) + (type $k (;10;) (sub $j (func (param (ref $a)) (result (ref $c))))) + (type $l (;11;) (sub $j (func (param (ref $b)) (result (ref $b))))) (type $m (;12;) (sub (array (mut i32)))) (type $n (;13;) (sub $m (array i32))) (type $o (;14;) (sub (array i32))) @@ -30,19 +30,19 @@ (type $rr (;28;) (sub $q (array arrayref))) (type $rr1 (;29;) (sub $q1 (array arrayref))) (type $ss (;30;) (sub $rr (array (ref array)))) - (type $ss0 (;31;) (sub $ss (array (ref 28)))) + (type $ss0 (;31;) (sub $ss (array (ref $rr)))) (type $ss1 (;32;) (sub $q1 (array (ref array)))) - (type (;33;) (sub $q1 (array (ref 28)))) + (type (;33;) (sub $q1 (array (ref $rr)))) (type $ss2 (;34;) (sub $q2 (array (ref array)))) - (type (;35;) (sub $q2 (array (ref 28)))) + (type (;35;) (sub $q2 (array (ref $rr)))) (type $rrr (;36;) (sub $q (array structref))) (type $rrr1 (;37;) (sub $q1 (array structref))) (type $sss (;38;) (sub $rrr (array (ref struct)))) - (type $sss0 (;39;) (sub $rrr (array (ref null 4)))) + (type $sss0 (;39;) (sub $rrr (array (ref null $d)))) (type $sss1 (;40;) (sub $q1 (array (ref struct)))) - (type (;41;) (sub $q1 (array (ref 4)))) + (type (;41;) (sub $q1 (array (ref $d)))) (type $sss2 (;42;) (sub $q2 (array (ref struct)))) - (type (;43;) (sub $q2 (array (ref 4)))) + (type (;43;) (sub $q2 (array (ref $d)))) (type $z1 (;44;) (sub $q (array (mut nullref)))) (type $z2 (;45;) (sub $q0 (array (ref none)))) (type $z3 (;46;) (sub $z1 (array (mut (ref none))))) @@ -58,8 +58,8 @@ (type $t (;56;) (sub (array (mut funcref)))) (type $u (;57;) (sub $t (array funcref))) (type $v (;58;) (sub $u (array (ref func)))) - (type $w (;59;) (sub $v (array (ref 0)))) - (type $x (;60;) (sub $t (array (ref null 0)))) + (type $w (;59;) (sub $v (array (ref $a)))) + (type $x (;60;) (sub $t (array (ref null $a)))) (type $y (;61;) (sub $w (array (ref nofunc)))) (type $z (;62;) (sub $x (array nullfuncref))) (type $t0 (;63;) (sub (array (mut externref)))) diff --git a/tests/snapshots/local/gc/rec-group-local.wat.print b/tests/snapshots/local/gc/rec-group-local.wat.print index 693a6547f6..908b22799d 100644 --- a/tests/snapshots/local/gc/rec-group-local.wat.print +++ b/tests/snapshots/local/gc/rec-group-local.wat.print @@ -1,10 +1,10 @@ (module (rec - (type $f (;0;) (func (param (ref 1)))) + (type $f (;0;) (func (param (ref $g)))) (type $g (;1;) (func)) ) - (type (;2;) (func (param (ref 0) (ref 1)))) - (func (;0;) (type 2) (param (ref 0) (ref 1)) + (type (;2;) (func (param (ref $f) (ref $g)))) + (func (;0;) (type 2) (param (ref $f) (ref $g)) local.get 1 local.get 0 call_ref $f diff --git a/tests/snapshots/local/gc/subtype-of-self-recursive-type.wast/0.print b/tests/snapshots/local/gc/subtype-of-self-recursive-type.wast/0.print index fe545455c8..870d16fa26 100644 --- a/tests/snapshots/local/gc/subtype-of-self-recursive-type.wast/0.print +++ b/tests/snapshots/local/gc/subtype-of-self-recursive-type.wast/0.print @@ -1,7 +1,7 @@ (module (type $t (;0;) (sub (struct (field anyref)))) (rec - (type $r (;1;) (sub $t (struct (field (ref 1))))) + (type $r (;1;) (sub $t (struct (field (ref $r))))) ) - (type $t' (;2;) (sub $r (struct (field (ref 1)) (field i32)))) + (type $t' (;2;) (sub $r (struct (field (ref $r)) (field i32)))) ) diff --git a/tests/snapshots/local/gc/type-equivalence.wast/0.print b/tests/snapshots/local/gc/type-equivalence.wast/0.print index 363cd4f26c..d5c0f44628 100644 --- a/tests/snapshots/local/gc/type-equivalence.wast/0.print +++ b/tests/snapshots/local/gc/type-equivalence.wast/0.print @@ -1,13 +1,13 @@ (module (type $t1 (;0;) (func (param f32 f32) (result f32))) (type $t2 (;1;) (func (param f32 f32) (result f32))) - (type (;2;) (func (param (ref 0)))) - (type (;3;) (func (param (ref 1)))) - (func $f1 (;0;) (type 2) (param $r (ref 0)) + (type (;2;) (func (param (ref $t1)))) + (type (;3;) (func (param (ref $t2)))) + (func $f1 (;0;) (type 2) (param $r (ref $t1)) local.get $r call $f2 ) - (func $f2 (;1;) (type 3) (param $r (ref 1)) + (func $f2 (;1;) (type 3) (param $r (ref $t2)) local.get $r call $f1 ) diff --git a/tests/snapshots/local/gc/type-equivalence.wast/1.print b/tests/snapshots/local/gc/type-equivalence.wast/1.print index c76660d600..1167493998 100644 --- a/tests/snapshots/local/gc/type-equivalence.wast/1.print +++ b/tests/snapshots/local/gc/type-equivalence.wast/1.print @@ -1,16 +1,16 @@ (module (type $s0 (;0;) (func (param i32) (result f32))) - (type $s1 (;1;) (func (param i32 (ref 0)) (result (ref 0)))) - (type $s2 (;2;) (func (param i32 (ref 0)) (result (ref 0)))) - (type $t1 (;3;) (func (param (ref 1)) (result (ref 2)))) - (type $t2 (;4;) (func (param (ref 2)) (result (ref 1)))) - (type (;5;) (func (param (ref 3)))) - (type (;6;) (func (param (ref 4)))) - (func $f1 (;0;) (type 5) (param $r (ref 3)) + (type $s1 (;1;) (func (param i32 (ref $s0)) (result (ref $s0)))) + (type $s2 (;2;) (func (param i32 (ref $s0)) (result (ref $s0)))) + (type $t1 (;3;) (func (param (ref $s1)) (result (ref $s2)))) + (type $t2 (;4;) (func (param (ref $s2)) (result (ref $s1)))) + (type (;5;) (func (param (ref $t1)))) + (type (;6;) (func (param (ref $t2)))) + (func $f1 (;0;) (type 5) (param $r (ref $t1)) local.get $r call $f2 ) - (func $f2 (;1;) (type 6) (param $r (ref 4)) + (func $f2 (;1;) (type 6) (param $r (ref $t2)) local.get $r call $f1 ) diff --git a/tests/snapshots/local/gc/type-equivalence.wast/10.print b/tests/snapshots/local/gc/type-equivalence.wast/10.print index d566b45e6d..063cc5834b 100644 --- a/tests/snapshots/local/gc/type-equivalence.wast/10.print +++ b/tests/snapshots/local/gc/type-equivalence.wast/10.print @@ -1,5 +1,5 @@ (module (type $t2 (;0;) (func (param f32 f32) (result f32))) - (type (;1;) (func (param (ref 0)))) + (type (;1;) (func (param (ref $t2)))) (import "M" "f" (func (;0;) (type 1))) ) diff --git a/tests/snapshots/local/gc/type-equivalence.wast/11.print b/tests/snapshots/local/gc/type-equivalence.wast/11.print index aeef19eac6..66a9157ef6 100644 --- a/tests/snapshots/local/gc/type-equivalence.wast/11.print +++ b/tests/snapshots/local/gc/type-equivalence.wast/11.print @@ -1,12 +1,12 @@ (module (type $s0 (;0;) (func (param i32) (result f32))) - (type $s1 (;1;) (func (param i32 (ref 0)) (result (ref 0)))) - (type $s2 (;2;) (func (param i32 (ref 0)) (result (ref 0)))) - (type $t1 (;3;) (func (param (ref 1)) (result (ref 2)))) - (type $t2 (;4;) (func (param (ref 2)) (result (ref 1)))) - (type (;5;) (func (param (ref 3)))) - (func (;0;) (type 5) (param (ref 3))) - (func (;1;) (type 5) (param (ref 3))) + (type $s1 (;1;) (func (param i32 (ref $s0)) (result (ref $s0)))) + (type $s2 (;2;) (func (param i32 (ref $s0)) (result (ref $s0)))) + (type $t1 (;3;) (func (param (ref $s1)) (result (ref $s2)))) + (type $t2 (;4;) (func (param (ref $s2)) (result (ref $s1)))) + (type (;5;) (func (param (ref $t1)))) + (func (;0;) (type 5) (param (ref $t1))) + (func (;1;) (type 5) (param (ref $t1))) (export "f1" (func 0)) (export "f2" (func 1)) ) diff --git a/tests/snapshots/local/gc/type-equivalence.wast/13.print b/tests/snapshots/local/gc/type-equivalence.wast/13.print index 51f0badef9..0edb482785 100644 --- a/tests/snapshots/local/gc/type-equivalence.wast/13.print +++ b/tests/snapshots/local/gc/type-equivalence.wast/13.print @@ -1,11 +1,11 @@ (module (type $s0 (;0;) (func (param i32) (result f32))) - (type $s1 (;1;) (func (param i32 (ref 0)) (result (ref 0)))) - (type $s2 (;2;) (func (param i32 (ref 0)) (result (ref 0)))) - (type $t1 (;3;) (func (param (ref 1)) (result (ref 2)))) - (type $t2 (;4;) (func (param (ref 2)) (result (ref 1)))) - (type (;5;) (func (param (ref 3)))) - (type (;6;) (func (param (ref 4)))) + (type $s1 (;1;) (func (param i32 (ref $s0)) (result (ref $s0)))) + (type $s2 (;2;) (func (param i32 (ref $s0)) (result (ref $s0)))) + (type $t1 (;3;) (func (param (ref $s1)) (result (ref $s2)))) + (type $t2 (;4;) (func (param (ref $s2)) (result (ref $s1)))) + (type (;5;) (func (param (ref $t1)))) + (type (;6;) (func (param (ref $t2)))) (import "M" "f1" (func (;0;) (type 5))) (import "M" "f1" (func (;1;) (type 6))) (import "M" "f2" (func (;2;) (type 5))) diff --git a/tests/snapshots/local/gc/type-equivalence.wast/2.print b/tests/snapshots/local/gc/type-equivalence.wast/2.print index ab891be9d0..2237c0b35d 100644 --- a/tests/snapshots/local/gc/type-equivalence.wast/2.print +++ b/tests/snapshots/local/gc/type-equivalence.wast/2.print @@ -1,3 +1,3 @@ (module - (type $t (;0;) (func (result (ref 0)))) + (type $t (;0;) (func (result (ref $t)))) ) diff --git a/tests/snapshots/local/gc/type-equivalence.wast/6.print b/tests/snapshots/local/gc/type-equivalence.wast/6.print index ea0aae42cf..7a8741b793 100644 --- a/tests/snapshots/local/gc/type-equivalence.wast/6.print +++ b/tests/snapshots/local/gc/type-equivalence.wast/6.print @@ -1,14 +1,14 @@ (module (type $s0 (;0;) (func (param i32))) - (type $s1 (;1;) (func (param i32 (ref 0)))) - (type $s2 (;2;) (func (param i32 (ref 0)))) - (type $t1 (;3;) (func (param (ref 1)))) - (type $t2 (;4;) (func (param (ref 2)))) + (type $s1 (;1;) (func (param i32 (ref $s0)))) + (type $s2 (;2;) (func (param i32 (ref $s0)))) + (type $t1 (;3;) (func (param (ref $s1)))) + (type $t2 (;4;) (func (param (ref $s2)))) (type (;5;) (func)) - (func $s1 (;0;) (type $s1) (param i32 (ref 0))) - (func $s2 (;1;) (type $s2) (param i32 (ref 0))) - (func $f1 (;2;) (type $t1) (param (ref 1))) - (func $f2 (;3;) (type $t2) (param (ref 2))) + (func $s1 (;0;) (type $s1) (param i32 (ref $s0))) + (func $s2 (;1;) (type $s2) (param i32 (ref $s0))) + (func $f1 (;2;) (type $t1) (param (ref $s1))) + (func $f2 (;3;) (type $t2) (param (ref $s2))) (func (;4;) (type 5) ref.func $s1 i32.const 0 diff --git a/tests/snapshots/local/gc/type-equivalence.wast/8.print b/tests/snapshots/local/gc/type-equivalence.wast/8.print index 4ecfdf1af0..f9f69387ba 100644 --- a/tests/snapshots/local/gc/type-equivalence.wast/8.print +++ b/tests/snapshots/local/gc/type-equivalence.wast/8.print @@ -1,6 +1,6 @@ (module (type $t1 (;0;) (func (param f32 f32) (result f32))) - (type (;1;) (func (param (ref 0)))) - (func (;0;) (type 1) (param (ref 0))) + (type (;1;) (func (param (ref $t1)))) + (func (;0;) (type 1) (param (ref $t1))) (export "f" (func 0)) ) diff --git a/tests/snapshots/local/gc/type-subtyping.wast/0.print b/tests/snapshots/local/gc/type-subtyping.wast/0.print index 4201d2af22..35679ff956 100644 --- a/tests/snapshots/local/gc/type-subtyping.wast/0.print +++ b/tests/snapshots/local/gc/type-subtyping.wast/0.print @@ -2,8 +2,8 @@ (type $e0 (;0;) (sub (array i32))) (type $e1 (;1;) (sub $e0 (array i32))) (type $e2 (;2;) (sub (array anyref))) - (type $e3 (;3;) (sub (array (ref null 0)))) - (type $e4 (;4;) (sub (array (ref 1)))) + (type $e3 (;3;) (sub (array (ref null $e0)))) + (type $e4 (;4;) (sub (array (ref $e1)))) (type $m1 (;5;) (sub (array (mut i32)))) (type $m2 (;6;) (sub $m1 (array (mut i32)))) ) diff --git a/tests/snapshots/local/gc/type-subtyping.wast/1.print b/tests/snapshots/local/gc/type-subtyping.wast/1.print index 66383bb384..7608033e21 100644 --- a/tests/snapshots/local/gc/type-subtyping.wast/1.print +++ b/tests/snapshots/local/gc/type-subtyping.wast/1.print @@ -2,7 +2,7 @@ (type $e0 (;0;) (sub (struct))) (type $e1 (;1;) (sub $e0 (struct))) (type $e2 (;2;) (sub $e1 (struct (field i32)))) - (type $e3 (;3;) (sub $e2 (struct (field i32) (field (ref null 0))))) - (type $e4 (;4;) (sub $e3 (struct (field i32) (field (ref 0)) (field (mut i64))))) - (type $e5 (;5;) (sub $e4 (struct (field i32) (field (ref 1)) (field (mut i64))))) + (type $e3 (;3;) (sub $e2 (struct (field i32) (field (ref null $e0))))) + (type $e4 (;4;) (sub $e3 (struct (field i32) (field (ref $e0)) (field (mut i64))))) + (type $e5 (;5;) (sub $e4 (struct (field i32) (field (ref $e1)) (field (mut i64))))) ) diff --git a/tests/snapshots/local/gc/type-subtyping.wast/11.print b/tests/snapshots/local/gc/type-subtyping.wast/11.print index d99bb17549..818a6c3a4f 100644 --- a/tests/snapshots/local/gc/type-subtyping.wast/11.print +++ b/tests/snapshots/local/gc/type-subtyping.wast/11.print @@ -1,16 +1,16 @@ (module (rec (type $f1 (;0;) (sub (func))) - (type (;1;) (struct (field (ref 0)))) + (type (;1;) (struct (field (ref $f1)))) ) (rec (type $f2 (;2;) (sub (func))) - (type (;3;) (struct (field (ref 2)))) + (type (;3;) (struct (field (ref $f2)))) ) (rec (type $g (;4;) (sub $f1 (func))) (type (;5;) (struct)) ) (func $g (;0;) (type $g)) - (global (;0;) (ref 0) ref.func $g) + (global (;0;) (ref $f1) ref.func $g) ) diff --git a/tests/snapshots/local/gc/type-subtyping.wast/12.print b/tests/snapshots/local/gc/type-subtyping.wast/12.print index 9a2816ccc6..e349860da2 100644 --- a/tests/snapshots/local/gc/type-subtyping.wast/12.print +++ b/tests/snapshots/local/gc/type-subtyping.wast/12.print @@ -1,25 +1,25 @@ (module (rec (type $f1 (;0;) (sub (func))) - (type $s1 (;1;) (sub (struct (field (ref 0))))) + (type $s1 (;1;) (sub (struct (field (ref $f1))))) ) (rec (type $f2 (;2;) (sub (func))) - (type $s2 (;3;) (sub (struct (field (ref 2))))) + (type $s2 (;3;) (sub (struct (field (ref $f2))))) ) (rec (type $g1 (;4;) (sub $f1 (func))) - (type (;5;) (sub $s1 (struct (field (ref 0)) (field (ref 0)) (field (ref 2)) (field (ref 2)) (field (ref 4))))) + (type (;5;) (sub $s1 (struct (field (ref $f1)) (field (ref $f1)) (field (ref $f2)) (field (ref $f2)) (field (ref $g1))))) ) (rec (type $g2 (;6;) (sub $f2 (func))) - (type (;7;) (sub $s2 (struct (field (ref 0)) (field (ref 2)) (field (ref 0)) (field (ref 2)) (field (ref 6))))) + (type (;7;) (sub $s2 (struct (field (ref $f1)) (field (ref $f2)) (field (ref $f1)) (field (ref $f2)) (field (ref $g2))))) ) (rec (type $h (;8;) (sub $g2 (func))) (type (;9;) (struct)) ) (func $h (;0;) (type $h)) - (global (;0;) (ref 0) ref.func $h) - (global (;1;) (ref 4) ref.func $h) + (global (;0;) (ref $f1) ref.func $h) + (global (;1;) (ref $g1) ref.func $h) ) diff --git a/tests/snapshots/local/gc/type-subtyping.wast/13.print b/tests/snapshots/local/gc/type-subtyping.wast/13.print index 1fcbc4fa48..f98f044e99 100644 --- a/tests/snapshots/local/gc/type-subtyping.wast/13.print +++ b/tests/snapshots/local/gc/type-subtyping.wast/13.print @@ -1,20 +1,20 @@ (module (rec (type $f11 (;0;) (sub (func (result (ref func))))) - (type $f12 (;1;) (sub $f11 (func (result (ref 0))))) + (type $f12 (;1;) (sub $f11 (func (result (ref $f11))))) ) (rec (type $f21 (;2;) (sub (func (result (ref func))))) - (type $f22 (;3;) (sub $f21 (func (result (ref 2))))) + (type $f22 (;3;) (sub $f21 (func (result (ref $f21))))) ) (func $f11 (;0;) (type $f11) (result (ref func)) unreachable ) - (func $f12 (;1;) (type $f12) (result (ref 0)) + (func $f12 (;1;) (type $f12) (result (ref $f11)) unreachable ) - (global (;0;) (ref 0) ref.func $f11) - (global (;1;) (ref 2) ref.func $f11) - (global (;2;) (ref 1) ref.func $f12) - (global (;3;) (ref 3) ref.func $f12) + (global (;0;) (ref $f11) ref.func $f11) + (global (;1;) (ref $f21) ref.func $f11) + (global (;2;) (ref $f12) ref.func $f12) + (global (;3;) (ref $f22) ref.func $f12) ) diff --git a/tests/snapshots/local/gc/type-subtyping.wast/14.print b/tests/snapshots/local/gc/type-subtyping.wast/14.print index f7cf76f779..8961773ebc 100644 --- a/tests/snapshots/local/gc/type-subtyping.wast/14.print +++ b/tests/snapshots/local/gc/type-subtyping.wast/14.print @@ -1,32 +1,32 @@ (module (rec (type $f11 (;0;) (sub (func (result (ref func))))) - (type $f12 (;1;) (sub $f11 (func (result (ref 0))))) + (type $f12 (;1;) (sub $f11 (func (result (ref $f11))))) ) (rec (type $f21 (;2;) (sub (func (result (ref func))))) - (type $f22 (;3;) (sub $f21 (func (result (ref 2))))) + (type $f22 (;3;) (sub $f21 (func (result (ref $f21))))) ) (rec (type $g11 (;4;) (sub $f11 (func (result (ref func))))) - (type $g12 (;5;) (sub $g11 (func (result (ref 4))))) + (type $g12 (;5;) (sub $g11 (func (result (ref $g11))))) ) (rec (type $g21 (;6;) (sub $f21 (func (result (ref func))))) - (type $g22 (;7;) (sub $g21 (func (result (ref 6))))) + (type $g22 (;7;) (sub $g21 (func (result (ref $g21))))) ) (func $g11 (;0;) (type $g11) (result (ref func)) unreachable ) - (func $g12 (;1;) (type $g12) (result (ref 4)) + (func $g12 (;1;) (type $g12) (result (ref $g11)) unreachable ) - (global (;0;) (ref 0) ref.func $g11) - (global (;1;) (ref 2) ref.func $g11) - (global (;2;) (ref 0) ref.func $g12) - (global (;3;) (ref 2) ref.func $g12) - (global (;4;) (ref 4) ref.func $g11) - (global (;5;) (ref 6) ref.func $g11) - (global (;6;) (ref 5) ref.func $g12) - (global (;7;) (ref 7) ref.func $g12) + (global (;0;) (ref $f11) ref.func $g11) + (global (;1;) (ref $f21) ref.func $g11) + (global (;2;) (ref $f11) ref.func $g12) + (global (;3;) (ref $f21) ref.func $g12) + (global (;4;) (ref $g11) ref.func $g11) + (global (;5;) (ref $g21) ref.func $g11) + (global (;6;) (ref $g12) ref.func $g12) + (global (;7;) (ref $g22) ref.func $g12) ) diff --git a/tests/snapshots/local/gc/type-subtyping.wast/17.print b/tests/snapshots/local/gc/type-subtyping.wast/17.print index f427604ff9..269bc81a28 100644 --- a/tests/snapshots/local/gc/type-subtyping.wast/17.print +++ b/tests/snapshots/local/gc/type-subtyping.wast/17.print @@ -1,20 +1,20 @@ (module (type $t0 (;0;) (sub (func (result funcref)))) (rec - (type $t1 (;1;) (sub $t0 (func (result (ref null 1))))) + (type $t1 (;1;) (sub $t0 (func (result (ref null $t1))))) ) (rec - (type $t2 (;2;) (sub $t1 (func (result (ref null 2))))) + (type $t2 (;2;) (sub $t1 (func (result (ref null $t2))))) ) (type (;3;) (func)) (func $f0 (;0;) (type $t0) (result funcref) ref.null func ) - (func $f1 (;1;) (type $t1) (result (ref null 1)) - ref.null 1 + (func $f1 (;1;) (type $t1) (result (ref null $t1)) + ref.null $t1 ) - (func $f2 (;2;) (type $t2) (result (ref null 2)) - ref.null 2 + (func $f2 (;2;) (type $t2) (result (ref null $t2)) + ref.null $t2 ) (func (;3;) (type 3) block (result funcref) ;; label = @1 @@ -29,66 +29,66 @@ i32.const 2 call_indirect (type $t0) end - block (result (ref null 1)) ;; label = @1 + block (result (ref null $t1)) ;; label = @1 i32.const 1 call_indirect (type $t1) end - block (result (ref null 1)) ;; label = @1 + block (result (ref null $t1)) ;; label = @1 i32.const 2 call_indirect (type $t1) end - block (result (ref null 2)) ;; label = @1 + block (result (ref null $t2)) ;; label = @1 i32.const 2 call_indirect (type $t2) end - block (result (ref null 0)) ;; label = @1 + block (result (ref null $t0)) ;; label = @1 i32.const 0 table.get 0 - ref.cast (ref 0) + ref.cast (ref $t0) end - block (result (ref null 0)) ;; label = @1 + block (result (ref null $t0)) ;; label = @1 i32.const 1 table.get 0 - ref.cast (ref 0) + ref.cast (ref $t0) end - block (result (ref null 0)) ;; label = @1 + block (result (ref null $t0)) ;; label = @1 i32.const 2 table.get 0 - ref.cast (ref 0) + ref.cast (ref $t0) end - block (result (ref null 1)) ;; label = @1 + block (result (ref null $t1)) ;; label = @1 i32.const 1 table.get 0 - ref.cast (ref 1) + ref.cast (ref $t1) end - block (result (ref null 1)) ;; label = @1 + block (result (ref null $t1)) ;; label = @1 i32.const 2 table.get 0 - ref.cast (ref 1) + ref.cast (ref $t1) end - block (result (ref null 2)) ;; label = @1 + block (result (ref null $t2)) ;; label = @1 i32.const 2 table.get 0 - ref.cast (ref 2) + ref.cast (ref $t2) end br 0 (;@0;) ) (func (;4;) (type 3) - block (result (ref null 1)) ;; label = @1 + block (result (ref null $t1)) ;; label = @1 i32.const 0 call_indirect (type $t1) end br 0 (;@0;) ) (func (;5;) (type 3) - block (result (ref null 1)) ;; label = @1 + block (result (ref null $t1)) ;; label = @1 i32.const 0 call_indirect (type $t2) end br 0 (;@0;) ) (func (;6;) (type 3) - block (result (ref null 1)) ;; label = @1 + block (result (ref null $t1)) ;; label = @1 i32.const 1 call_indirect (type $t2) end @@ -97,19 +97,19 @@ (func (;7;) (type 3) i32.const 0 table.get 0 - ref.cast (ref 1) + ref.cast (ref $t1) br 0 (;@0;) ) (func (;8;) (type 3) i32.const 0 table.get 0 - ref.cast (ref 2) + ref.cast (ref $t2) br 0 (;@0;) ) (func (;9;) (type 3) i32.const 1 table.get 0 - ref.cast (ref 2) + ref.cast (ref $t2) br 0 (;@0;) ) (table (;0;) 3 3 funcref) diff --git a/tests/snapshots/local/gc/type-subtyping.wast/2.print b/tests/snapshots/local/gc/type-subtyping.wast/2.print index 275cc61aa2..52521cefc5 100644 --- a/tests/snapshots/local/gc/type-subtyping.wast/2.print +++ b/tests/snapshots/local/gc/type-subtyping.wast/2.print @@ -1,8 +1,8 @@ (module (type $s (;0;) (sub (struct))) (type $s' (;1;) (sub $s (struct))) - (type $f1 (;2;) (sub (func (param (ref 1)) (result anyref)))) - (type $f2 (;3;) (sub $f1 (func (param (ref 0)) (result (ref any))))) - (type $f3 (;4;) (sub $f2 (func (param (ref null 0)) (result (ref 0))))) - (type $f4 (;5;) (sub $f3 (func (param structref) (result (ref 1))))) + (type $f1 (;2;) (sub (func (param (ref $s')) (result anyref)))) + (type $f2 (;3;) (sub $f1 (func (param (ref $s)) (result (ref any))))) + (type $f3 (;4;) (sub $f2 (func (param (ref null $s)) (result (ref $s))))) + (type $f4 (;5;) (sub $f3 (func (param structref) (result (ref $s'))))) ) diff --git a/tests/snapshots/local/gc/type-subtyping.wast/25.print b/tests/snapshots/local/gc/type-subtyping.wast/25.print index 53c512d6bb..7a3c81e1ed 100644 --- a/tests/snapshots/local/gc/type-subtyping.wast/25.print +++ b/tests/snapshots/local/gc/type-subtyping.wast/25.print @@ -18,13 +18,13 @@ (func (;4;) (type $t1) i32.const 1 table.get 0 - ref.cast (ref 0) + ref.cast (ref $t1) drop ) (func (;5;) (type $t1) i32.const 0 table.get 0 - ref.cast (ref 1) + ref.cast (ref $t2) drop ) (table (;0;) 2 2 funcref) diff --git a/tests/snapshots/local/gc/type-subtyping.wast/3.print b/tests/snapshots/local/gc/type-subtyping.wast/3.print index fe545455c8..870d16fa26 100644 --- a/tests/snapshots/local/gc/type-subtyping.wast/3.print +++ b/tests/snapshots/local/gc/type-subtyping.wast/3.print @@ -1,7 +1,7 @@ (module (type $t (;0;) (sub (struct (field anyref)))) (rec - (type $r (;1;) (sub $t (struct (field (ref 1))))) + (type $r (;1;) (sub $t (struct (field (ref $r))))) ) - (type $t' (;2;) (sub $r (struct (field (ref 1)) (field i32)))) + (type $t' (;2;) (sub $r (struct (field (ref $r)) (field i32)))) ) diff --git a/tests/snapshots/local/gc/type-subtyping.wast/30.print b/tests/snapshots/local/gc/type-subtyping.wast/30.print index 7ea9ee51cd..52fbaef1df 100644 --- a/tests/snapshots/local/gc/type-subtyping.wast/30.print +++ b/tests/snapshots/local/gc/type-subtyping.wast/30.print @@ -1,11 +1,11 @@ (module (rec (type $f1 (;0;) (sub (func))) - (type (;1;) (struct (field (ref 0)))) + (type (;1;) (struct (field (ref $f1)))) ) (rec (type $f2 (;2;) (sub (func))) - (type (;3;) (struct (field (ref 2)))) + (type (;3;) (struct (field (ref $f2)))) ) (rec (type $g1 (;4;) (sub $f1 (func))) @@ -19,7 +19,7 @@ (func $g (;0;) (type $g2)) (func (;1;) (type 8) (result i32) ref.func $g - ref.test (ref 4) + ref.test (ref $g1) ) (export "run" (func 1)) (elem (;0;) declare func $g) diff --git a/tests/snapshots/local/gc/type-subtyping.wast/32.print b/tests/snapshots/local/gc/type-subtyping.wast/32.print index 5bfac5bbdb..73d9873650 100644 --- a/tests/snapshots/local/gc/type-subtyping.wast/32.print +++ b/tests/snapshots/local/gc/type-subtyping.wast/32.print @@ -1,25 +1,25 @@ (module (rec (type $f1 (;0;) (sub (func))) - (type $s1 (;1;) (sub (struct (field (ref 0))))) + (type $s1 (;1;) (sub (struct (field (ref $f1))))) ) (rec (type $f2 (;2;) (sub (func))) - (type $s2 (;3;) (sub (struct (field (ref 2))))) + (type $s2 (;3;) (sub (struct (field (ref $f2))))) ) (rec (type $g1 (;4;) (sub $f1 (func))) - (type (;5;) (sub $s1 (struct (field (ref 0)) (field (ref 0)) (field (ref 2)) (field (ref 2)) (field (ref 4))))) + (type (;5;) (sub $s1 (struct (field (ref $f1)) (field (ref $f1)) (field (ref $f2)) (field (ref $f2)) (field (ref $g1))))) ) (rec (type $g2 (;6;) (sub $f2 (func))) - (type (;7;) (sub $s2 (struct (field (ref 0)) (field (ref 2)) (field (ref 0)) (field (ref 2)) (field (ref 6))))) + (type (;7;) (sub $s2 (struct (field (ref $f1)) (field (ref $f2)) (field (ref $f1)) (field (ref $f2)) (field (ref $g2))))) ) (type (;8;) (func (result i32))) (func $g (;0;) (type $g2)) (func (;1;) (type 8) (result i32) ref.func $g - ref.test (ref 4) + ref.test (ref $g1) ) (export "run" (func 1)) (elem (;0;) declare func $g) diff --git a/tests/snapshots/local/gc/type-subtyping.wast/34.print b/tests/snapshots/local/gc/type-subtyping.wast/34.print index 6b716dd980..26645c88d5 100644 --- a/tests/snapshots/local/gc/type-subtyping.wast/34.print +++ b/tests/snapshots/local/gc/type-subtyping.wast/34.print @@ -1,28 +1,28 @@ (module (rec (type $f11 (;0;) (sub (func (result (ref func))))) - (type $f12 (;1;) (sub $f11 (func (result (ref 0))))) + (type $f12 (;1;) (sub $f11 (func (result (ref $f11))))) ) (rec (type $f21 (;2;) (sub (func (result (ref func))))) - (type $f22 (;3;) (sub $f21 (func (result (ref 2))))) + (type $f22 (;3;) (sub $f21 (func (result (ref $f21))))) ) (type (;4;) (func (result i32 i32 i32 i32))) (func $f11 (;0;) (type $f11) (result (ref func)) unreachable ) - (func $f12 (;1;) (type $f12) (result (ref 0)) + (func $f12 (;1;) (type $f12) (result (ref $f11)) unreachable ) (func (;2;) (type 4) (result i32 i32 i32 i32) ref.func $f11 - ref.test (ref 0) + ref.test (ref $f11) ref.func $f11 - ref.test (ref 2) + ref.test (ref $f21) ref.func $f12 - ref.test (ref 1) + ref.test (ref $f12) ref.func $f12 - ref.test (ref 3) + ref.test (ref $f22) ) (export "run" (func 2)) (elem (;0;) declare func $f11) diff --git a/tests/snapshots/local/gc/type-subtyping.wast/36.print b/tests/snapshots/local/gc/type-subtyping.wast/36.print index 8cf61ab00e..5b1fc39f0e 100644 --- a/tests/snapshots/local/gc/type-subtyping.wast/36.print +++ b/tests/snapshots/local/gc/type-subtyping.wast/36.print @@ -1,19 +1,19 @@ (module (type $t0 (;0;) (sub (func (result funcref)))) (rec - (type $t1 (;1;) (sub $t0 (func (result (ref null 1))))) + (type $t1 (;1;) (sub $t0 (func (result (ref null $t1))))) ) (rec - (type $t2 (;2;) (sub $t1 (func (result (ref null 2))))) + (type $t2 (;2;) (sub $t1 (func (result (ref null $t2))))) ) (func (;0;) (type $t0) (result funcref) ref.null func ) - (func (;1;) (type $t1) (result (ref null 1)) - ref.null 1 + (func (;1;) (type $t1) (result (ref null $t1)) + ref.null $t1 ) - (func (;2;) (type $t2) (result (ref null 2)) - ref.null 2 + (func (;2;) (type $t2) (result (ref null $t2)) + ref.null $t2 ) (export "f0" (func 0)) (export "f1" (func 1)) diff --git a/tests/snapshots/local/gc/type-subtyping.wast/38.print b/tests/snapshots/local/gc/type-subtyping.wast/38.print index ce4b2db21b..a318aa0c18 100644 --- a/tests/snapshots/local/gc/type-subtyping.wast/38.print +++ b/tests/snapshots/local/gc/type-subtyping.wast/38.print @@ -1,10 +1,10 @@ (module (type $t0 (;0;) (sub (func (result funcref)))) (rec - (type $t1 (;1;) (sub $t0 (func (result (ref null 1))))) + (type $t1 (;1;) (sub $t0 (func (result (ref null $t1))))) ) (rec - (type $t2 (;2;) (sub $t1 (func (result (ref null 2))))) + (type $t2 (;2;) (sub $t1 (func (result (ref null $t2))))) ) (import "M" "f0" (func (;0;) (type $t0))) (import "M" "f1" (func (;1;) (type $t0))) diff --git a/tests/snapshots/local/gc/type-subtyping.wast/4.print b/tests/snapshots/local/gc/type-subtyping.wast/4.print index 517d86e508..0e68b11416 100644 --- a/tests/snapshots/local/gc/type-subtyping.wast/4.print +++ b/tests/snapshots/local/gc/type-subtyping.wast/4.print @@ -1,9 +1,9 @@ (module (rec - (type $r1 (;0;) (sub (struct (field i32) (field (ref 0))))) + (type $r1 (;0;) (sub (struct (field i32) (field (ref $r1))))) ) (rec - (type $r2 (;1;) (sub $r1 (struct (field i32) (field (ref 2))))) - (type $r3 (;2;) (sub $r1 (struct (field i32) (field (ref 1))))) + (type $r2 (;1;) (sub $r1 (struct (field i32) (field (ref $r3))))) + (type $r3 (;2;) (sub $r1 (struct (field i32) (field (ref $r2))))) ) ) diff --git a/tests/snapshots/local/gc/type-subtyping.wast/46.print b/tests/snapshots/local/gc/type-subtyping.wast/46.print index 560f2dd762..166d73dbbd 100644 --- a/tests/snapshots/local/gc/type-subtyping.wast/46.print +++ b/tests/snapshots/local/gc/type-subtyping.wast/46.print @@ -1,7 +1,7 @@ (module (rec (type $f2 (;0;) (sub (func))) - (type (;1;) (struct (field (ref 0)))) + (type (;1;) (struct (field (ref $f2)))) ) (rec (type $g2 (;2;) (sub $f2 (func))) diff --git a/tests/snapshots/local/gc/type-subtyping.wast/48.print b/tests/snapshots/local/gc/type-subtyping.wast/48.print index 3903b1a8d7..b1917adb71 100644 --- a/tests/snapshots/local/gc/type-subtyping.wast/48.print +++ b/tests/snapshots/local/gc/type-subtyping.wast/48.print @@ -1,7 +1,7 @@ (module (rec (type $f1 (;0;) (sub (func))) - (type (;1;) (struct (field (ref 0)))) + (type (;1;) (struct (field (ref $f1)))) ) (rec (type $g1 (;2;) (sub $f1 (func))) diff --git a/tests/snapshots/local/gc/type-subtyping.wast/49.print b/tests/snapshots/local/gc/type-subtyping.wast/49.print index 18fe676a98..311eba83f7 100644 --- a/tests/snapshots/local/gc/type-subtyping.wast/49.print +++ b/tests/snapshots/local/gc/type-subtyping.wast/49.print @@ -1,15 +1,15 @@ (module (rec (type $f1 (;0;) (sub (func))) - (type $s1 (;1;) (sub (struct (field (ref 0))))) + (type $s1 (;1;) (sub (struct (field (ref $f1))))) ) (rec (type $f2 (;2;) (sub (func))) - (type $s2 (;3;) (sub (struct (field (ref 2))))) + (type $s2 (;3;) (sub (struct (field (ref $f2))))) ) (rec (type $g2 (;4;) (sub $f2 (func))) - (type (;5;) (sub $s2 (struct (field (ref 0)) (field (ref 2)) (field (ref 0)) (field (ref 2)) (field (ref 4))))) + (type (;5;) (sub $s2 (struct (field (ref $f1)) (field (ref $f2)) (field (ref $f1)) (field (ref $f2)) (field (ref $g2))))) ) (func (;0;) (type $g2)) (export "g" (func 0)) diff --git a/tests/snapshots/local/gc/type-subtyping.wast/5.print b/tests/snapshots/local/gc/type-subtyping.wast/5.print index da048d536b..32d2465774 100644 --- a/tests/snapshots/local/gc/type-subtyping.wast/5.print +++ b/tests/snapshots/local/gc/type-subtyping.wast/5.print @@ -1,11 +1,11 @@ (module (rec - (type $a1 (;0;) (sub (struct (field i32) (field (ref 1))))) - (type $a2 (;1;) (sub (struct (field i64) (field (ref 0))))) + (type $a1 (;0;) (sub (struct (field i32) (field (ref $a2))))) + (type $a2 (;1;) (sub (struct (field i64) (field (ref $a1))))) ) (rec - (type $b1 (;2;) (sub $a2 (struct (field i64) (field (ref 0)) (field i32)))) - (type $b2 (;3;) (sub $a1 (struct (field i32) (field (ref 1)) (field i32)))) - (type $b3 (;4;) (sub $a2 (struct (field i64) (field (ref 3)) (field i32)))) + (type $b1 (;2;) (sub $a2 (struct (field i64) (field (ref $a1)) (field i32)))) + (type $b2 (;3;) (sub $a1 (struct (field i32) (field (ref $a2)) (field i32)))) + (type $b3 (;4;) (sub $a2 (struct (field i64) (field (ref $b2)) (field i32)))) ) ) diff --git a/tests/snapshots/local/gc/type-subtyping.wast/51.print b/tests/snapshots/local/gc/type-subtyping.wast/51.print index 88ee965808..d64d1bd057 100644 --- a/tests/snapshots/local/gc/type-subtyping.wast/51.print +++ b/tests/snapshots/local/gc/type-subtyping.wast/51.print @@ -1,15 +1,15 @@ (module (rec (type $f1 (;0;) (sub (func))) - (type $s1 (;1;) (sub (struct (field (ref 0))))) + (type $s1 (;1;) (sub (struct (field (ref $f1))))) ) (rec (type $f2 (;2;) (sub (func))) - (type $s2 (;3;) (sub (struct (field (ref 2))))) + (type $s2 (;3;) (sub (struct (field (ref $f2))))) ) (rec (type $g1 (;4;) (sub $f1 (func))) - (type (;5;) (sub $s1 (struct (field (ref 0)) (field (ref 0)) (field (ref 2)) (field (ref 2)) (field (ref 4))))) + (type (;5;) (sub $s1 (struct (field (ref $f1)) (field (ref $f1)) (field (ref $f2)) (field (ref $f2)) (field (ref $g1))))) ) (import "M4" "g" (func (;0;) (type $g1))) ) diff --git a/tests/snapshots/local/gc/type-subtyping.wast/52.print b/tests/snapshots/local/gc/type-subtyping.wast/52.print index e1759d6f5b..4933f3415d 100644 --- a/tests/snapshots/local/gc/type-subtyping.wast/52.print +++ b/tests/snapshots/local/gc/type-subtyping.wast/52.print @@ -1,11 +1,11 @@ (module (rec (type $f1 (;0;) (sub (func))) - (type (;1;) (struct (field (ref 0)))) + (type (;1;) (struct (field (ref $f1)))) ) (rec (type $f2 (;2;) (sub (func))) - (type (;3;) (struct (field (ref 0)))) + (type (;3;) (struct (field (ref $f1)))) ) (rec (type $g2 (;4;) (sub $f2 (func))) diff --git a/tests/snapshots/local/gc/type-subtyping.wast/55.print b/tests/snapshots/local/gc/type-subtyping.wast/55.print index 0f9fb4f6a6..650668d0a2 100644 --- a/tests/snapshots/local/gc/type-subtyping.wast/55.print +++ b/tests/snapshots/local/gc/type-subtyping.wast/55.print @@ -1,11 +1,11 @@ (module (rec (type $f1 (;0;) (sub (func))) - (type (;1;) (struct (field (ref 0)))) + (type (;1;) (struct (field (ref $f1)))) ) (rec (type $f2 (;2;) (sub (func))) - (type (;3;) (struct (field (ref 2)))) + (type (;3;) (struct (field (ref $f2)))) ) (rec (type $g (;4;) (sub $f1 (func))) diff --git a/tests/snapshots/local/gc/type-subtyping.wast/57.print b/tests/snapshots/local/gc/type-subtyping.wast/57.print index 6d1c669022..4b741c2aa1 100644 --- a/tests/snapshots/local/gc/type-subtyping.wast/57.print +++ b/tests/snapshots/local/gc/type-subtyping.wast/57.print @@ -1,11 +1,11 @@ (module (rec (type $f1 (;0;) (sub (func))) - (type (;1;) (struct (field (ref 0)))) + (type (;1;) (struct (field (ref $f1)))) ) (rec (type $f2 (;2;) (sub (func))) - (type (;3;) (struct (field (ref 2)))) + (type (;3;) (struct (field (ref $f2)))) ) (rec (type $g (;4;) (sub $f1 (func))) diff --git a/tests/snapshots/local/gc/type-subtyping.wast/58.print b/tests/snapshots/local/gc/type-subtyping.wast/58.print index 2dc8745471..678221f7d9 100644 --- a/tests/snapshots/local/gc/type-subtyping.wast/58.print +++ b/tests/snapshots/local/gc/type-subtyping.wast/58.print @@ -1,15 +1,15 @@ (module (rec (type $f1 (;0;) (sub (func))) - (type $s1 (;1;) (sub (struct (field (ref 0))))) + (type $s1 (;1;) (sub (struct (field (ref $f1))))) ) (rec (type $f2 (;2;) (sub (func))) - (type $s2 (;3;) (sub (struct (field (ref 2))))) + (type $s2 (;3;) (sub (struct (field (ref $f2))))) ) (rec (type $g2 (;4;) (sub $f2 (func))) - (type (;5;) (sub $s2 (struct (field (ref 0)) (field (ref 2)) (field (ref 0)) (field (ref 2)) (field (ref 4))))) + (type (;5;) (sub $s2 (struct (field (ref $f1)) (field (ref $f2)) (field (ref $f1)) (field (ref $f2)) (field (ref $g2))))) ) (rec (type $h (;6;) (sub $g2 (func))) diff --git a/tests/snapshots/local/gc/type-subtyping.wast/6.print b/tests/snapshots/local/gc/type-subtyping.wast/6.print index bf2985b0ca..967e74210c 100644 --- a/tests/snapshots/local/gc/type-subtyping.wast/6.print +++ b/tests/snapshots/local/gc/type-subtyping.wast/6.print @@ -1,23 +1,23 @@ (module (rec - (type $t1 (;0;) (sub (func (param i32 (ref 2))))) - (type $t2 (;1;) (sub $t1 (func (param i32 (ref 1))))) - (type $t3 (;2;) (sub $t2 (func (param i32 (ref 0))))) + (type $t1 (;0;) (sub (func (param i32 (ref $t3))))) + (type $t2 (;1;) (sub $t1 (func (param i32 (ref $t2))))) + (type $t3 (;2;) (sub $t2 (func (param i32 (ref $t1))))) ) - (type (;3;) (func (param (ref 0)))) - (type (;4;) (func (param (ref 1)))) - (type (;5;) (func (param (ref 2)))) - (func $f1 (;0;) (type 3) (param $r (ref 0)) + (type (;3;) (func (param (ref $t1)))) + (type (;4;) (func (param (ref $t2)))) + (type (;5;) (func (param (ref $t3)))) + (func $f1 (;0;) (type 3) (param $r (ref $t1)) local.get $r call $f1 ) - (func $f2 (;1;) (type 4) (param $r (ref 1)) + (func $f2 (;1;) (type 4) (param $r (ref $t2)) local.get $r call $f1 local.get $r call $f2 ) - (func $f3 (;2;) (type 5) (param $r (ref 2)) + (func $f3 (;2;) (type 5) (param $r (ref $t3)) local.get $r call $f1 local.get $r diff --git a/tests/snapshots/local/gc/type-subtyping.wast/60.print b/tests/snapshots/local/gc/type-subtyping.wast/60.print index 46fcc839de..da941728e4 100644 --- a/tests/snapshots/local/gc/type-subtyping.wast/60.print +++ b/tests/snapshots/local/gc/type-subtyping.wast/60.print @@ -1,15 +1,15 @@ (module (rec (type $f1 (;0;) (sub (func))) - (type $s1 (;1;) (sub (struct (field (ref 0))))) + (type $s1 (;1;) (sub (struct (field (ref $f1))))) ) (rec (type $f2 (;2;) (sub (func))) - (type $s2 (;3;) (sub (struct (field (ref 2))))) + (type $s2 (;3;) (sub (struct (field (ref $f2))))) ) (rec (type $g1 (;4;) (sub $f1 (func))) - (type (;5;) (sub $s1 (struct (field (ref 0)) (field (ref 0)) (field (ref 2)) (field (ref 2)) (field (ref 4))))) + (type (;5;) (sub $s1 (struct (field (ref $f1)) (field (ref $f1)) (field (ref $f2)) (field (ref $f2)) (field (ref $g1))))) ) (rec (type $h (;6;) (sub $g1 (func))) diff --git a/tests/snapshots/local/gc/type-subtyping.wast/61.print b/tests/snapshots/local/gc/type-subtyping.wast/61.print index eba797b389..9940d23b0e 100644 --- a/tests/snapshots/local/gc/type-subtyping.wast/61.print +++ b/tests/snapshots/local/gc/type-subtyping.wast/61.print @@ -1,16 +1,16 @@ (module (rec (type $f11 (;0;) (sub (func (result (ref func))))) - (type $f12 (;1;) (sub $f11 (func (result (ref 0))))) + (type $f12 (;1;) (sub $f11 (func (result (ref $f11))))) ) (rec (type $f21 (;2;) (sub (func (result (ref func))))) - (type $f22 (;3;) (sub $f21 (func (result (ref 2))))) + (type $f22 (;3;) (sub $f21 (func (result (ref $f21))))) ) (func (;0;) (type $f11) (result (ref func)) unreachable ) - (func (;1;) (type $f12) (result (ref 0)) + (func (;1;) (type $f12) (result (ref $f11)) unreachable ) (export "f11" (func 0)) diff --git a/tests/snapshots/local/gc/type-subtyping.wast/63.print b/tests/snapshots/local/gc/type-subtyping.wast/63.print index f274811014..5b4d259355 100644 --- a/tests/snapshots/local/gc/type-subtyping.wast/63.print +++ b/tests/snapshots/local/gc/type-subtyping.wast/63.print @@ -1,11 +1,11 @@ (module (rec (type $f11 (;0;) (sub (func (result (ref func))))) - (type $f12 (;1;) (sub $f11 (func (result (ref 0))))) + (type $f12 (;1;) (sub $f11 (func (result (ref $f11))))) ) (rec (type $f21 (;2;) (sub (func (result (ref func))))) - (type $f22 (;3;) (sub $f21 (func (result (ref 2))))) + (type $f22 (;3;) (sub $f21 (func (result (ref $f21))))) ) (import "M8" "f11" (func (;0;) (type $f11))) (import "M8" "f11" (func (;1;) (type $f21))) diff --git a/tests/snapshots/local/gc/type-subtyping.wast/64.print b/tests/snapshots/local/gc/type-subtyping.wast/64.print index 41499a753f..e46030e6f6 100644 --- a/tests/snapshots/local/gc/type-subtyping.wast/64.print +++ b/tests/snapshots/local/gc/type-subtyping.wast/64.print @@ -1,24 +1,24 @@ (module (rec (type $f11 (;0;) (sub (func (result (ref func))))) - (type $f12 (;1;) (sub $f11 (func (result (ref 0))))) + (type $f12 (;1;) (sub $f11 (func (result (ref $f11))))) ) (rec (type $f21 (;2;) (sub (func (result (ref func))))) - (type $f22 (;3;) (sub $f21 (func (result (ref 2))))) + (type $f22 (;3;) (sub $f21 (func (result (ref $f21))))) ) (rec (type $g11 (;4;) (sub $f11 (func (result (ref func))))) - (type $g12 (;5;) (sub $g11 (func (result (ref 4))))) + (type $g12 (;5;) (sub $g11 (func (result (ref $g11))))) ) (rec (type $g21 (;6;) (sub $f21 (func (result (ref func))))) - (type $g22 (;7;) (sub $g21 (func (result (ref 6))))) + (type $g22 (;7;) (sub $g21 (func (result (ref $g21))))) ) (func (;0;) (type $g11) (result (ref func)) unreachable ) - (func (;1;) (type $g12) (result (ref 4)) + (func (;1;) (type $g12) (result (ref $g11)) unreachable ) (export "g11" (func 0)) diff --git a/tests/snapshots/local/gc/type-subtyping.wast/66.print b/tests/snapshots/local/gc/type-subtyping.wast/66.print index 29f91f281f..6aeee7012c 100644 --- a/tests/snapshots/local/gc/type-subtyping.wast/66.print +++ b/tests/snapshots/local/gc/type-subtyping.wast/66.print @@ -1,19 +1,19 @@ (module (rec (type $f11 (;0;) (sub (func (result (ref func))))) - (type $f12 (;1;) (sub $f11 (func (result (ref 0))))) + (type $f12 (;1;) (sub $f11 (func (result (ref $f11))))) ) (rec (type $f21 (;2;) (sub (func (result (ref func))))) - (type $f22 (;3;) (sub $f21 (func (result (ref 2))))) + (type $f22 (;3;) (sub $f21 (func (result (ref $f21))))) ) (rec (type $g11 (;4;) (sub $f11 (func (result (ref func))))) - (type $g12 (;5;) (sub $g11 (func (result (ref 4))))) + (type $g12 (;5;) (sub $g11 (func (result (ref $g11))))) ) (rec (type $g21 (;6;) (sub $f21 (func (result (ref func))))) - (type $g22 (;7;) (sub $g21 (func (result (ref 6))))) + (type $g22 (;7;) (sub $g21 (func (result (ref $g21))))) ) (import "M9" "g11" (func (;0;) (type $f11))) (import "M9" "g11" (func (;1;) (type $f21))) diff --git a/tests/snapshots/local/gc/type-subtyping.wast/7.print b/tests/snapshots/local/gc/type-subtyping.wast/7.print index 7c0f5b77f2..ffcbe9c7a8 100644 --- a/tests/snapshots/local/gc/type-subtyping.wast/7.print +++ b/tests/snapshots/local/gc/type-subtyping.wast/7.print @@ -1,28 +1,28 @@ (module (rec - (type $t1 (;0;) (sub (func (result i32 (ref 1))))) - (type $u1 (;1;) (sub (func (result f32 (ref 0))))) + (type $t1 (;0;) (sub (func (result i32 (ref $u1))))) + (type $u1 (;1;) (sub (func (result f32 (ref $t1))))) ) (rec - (type $t2 (;2;) (sub $t1 (func (result i32 (ref 5))))) - (type $u2 (;3;) (sub $u1 (func (result f32 (ref 4))))) - (type $t3 (;4;) (sub $t1 (func (result i32 (ref 3))))) - (type $u3 (;5;) (sub $u1 (func (result f32 (ref 2))))) + (type $t2 (;2;) (sub $t1 (func (result i32 (ref $u3))))) + (type $u2 (;3;) (sub $u1 (func (result f32 (ref $t3))))) + (type $t3 (;4;) (sub $t1 (func (result i32 (ref $u2))))) + (type $u3 (;5;) (sub $u1 (func (result f32 (ref $t2))))) ) - (type (;6;) (func (param (ref 0)))) - (type (;7;) (func (param (ref 2)))) - (type (;8;) (func (param (ref 4)))) - (func $f1 (;0;) (type 6) (param $r (ref 0)) + (type (;6;) (func (param (ref $t1)))) + (type (;7;) (func (param (ref $t2)))) + (type (;8;) (func (param (ref $t3)))) + (func $f1 (;0;) (type 6) (param $r (ref $t1)) local.get $r call $f1 ) - (func $f2 (;1;) (type 7) (param $r (ref 2)) + (func $f2 (;1;) (type 7) (param $r (ref $t2)) local.get $r call $f1 local.get $r call $f2 ) - (func $f3 (;2;) (type 8) (param $r (ref 4)) + (func $f3 (;2;) (type 8) (param $r (ref $t3)) local.get $r call $f1 local.get $r diff --git a/tests/snapshots/local/gc/type-subtyping.wast/8.print b/tests/snapshots/local/gc/type-subtyping.wast/8.print index eb9de4aa7a..20d055b5b4 100644 --- a/tests/snapshots/local/gc/type-subtyping.wast/8.print +++ b/tests/snapshots/local/gc/type-subtyping.wast/8.print @@ -1,11 +1,11 @@ (module (rec (type $f1 (;0;) (sub (func))) - (type (;1;) (struct (field (ref 0)))) + (type (;1;) (struct (field (ref $f1)))) ) (rec (type $f2 (;2;) (sub (func))) - (type (;3;) (struct (field (ref 2)))) + (type (;3;) (struct (field (ref $f2)))) ) (rec (type $g1 (;4;) (sub $f1 (func))) @@ -16,5 +16,5 @@ (type (;7;) (struct)) ) (func $g (;0;) (type $g2)) - (global (;0;) (ref 4) ref.func $g) + (global (;0;) (ref $g1) ref.func $g) ) diff --git a/tests/snapshots/local/gc/type-subtyping.wast/9.print b/tests/snapshots/local/gc/type-subtyping.wast/9.print index 166dfab192..f8b1d74433 100644 --- a/tests/snapshots/local/gc/type-subtyping.wast/9.print +++ b/tests/snapshots/local/gc/type-subtyping.wast/9.print @@ -1,20 +1,20 @@ (module (rec (type $f1 (;0;) (sub (func))) - (type $s1 (;1;) (sub (struct (field (ref 0))))) + (type $s1 (;1;) (sub (struct (field (ref $f1))))) ) (rec (type $f2 (;2;) (sub (func))) - (type $s2 (;3;) (sub (struct (field (ref 2))))) + (type $s2 (;3;) (sub (struct (field (ref $f2))))) ) (rec (type $g1 (;4;) (sub $f1 (func))) - (type (;5;) (sub $s1 (struct (field (ref 0)) (field (ref 0)) (field (ref 2)) (field (ref 2)) (field (ref 4))))) + (type (;5;) (sub $s1 (struct (field (ref $f1)) (field (ref $f1)) (field (ref $f2)) (field (ref $f2)) (field (ref $g1))))) ) (rec (type $g2 (;6;) (sub $f2 (func))) - (type (;7;) (sub $s2 (struct (field (ref 0)) (field (ref 2)) (field (ref 0)) (field (ref 2)) (field (ref 6))))) + (type (;7;) (sub $s2 (struct (field (ref $f1)) (field (ref $f2)) (field (ref $f1)) (field (ref $f2)) (field (ref $g2))))) ) (func $g (;0;) (type $g2)) - (global (;0;) (ref 4) ref.func $g) + (global (;0;) (ref $g1) ref.func $g) ) diff --git a/tests/snapshots/local/typed-continuations/actor-lwt.wast/0.print b/tests/snapshots/local/typed-continuations/actor-lwt.wast/0.print index 116aa3ace8..4d6caf0965 100644 --- a/tests/snapshots/local/typed-continuations/actor-lwt.wast/0.print +++ b/tests/snapshots/local/typed-continuations/actor-lwt.wast/0.print @@ -2,10 +2,10 @@ (type $func (;0;) (func)) (type $cont (;1;) (cont $func)) (type (;2;) (func (result i32))) - (type (;3;) (func (param (ref 1)) (result i32))) + (type (;3;) (func (param (ref $cont)) (result i32))) (type (;4;) (func (param i32 i32))) (tag $self (;0;) (type 2) (result i32)) - (tag $spawn (;1;) (type 3) (param (ref 1)) (result i32)) + (tag $spawn (;1;) (type 3) (param (ref $cont)) (result i32)) (tag $send (;2;) (type 4) (param i32 i32)) (tag $recv (;3;) (type 2) (result i32)) (export "self" (tag 0)) diff --git a/tests/snapshots/local/typed-continuations/actor-lwt.wast/10.print b/tests/snapshots/local/typed-continuations/actor-lwt.wast/10.print index 6dec107915..6fd482867c 100644 --- a/tests/snapshots/local/typed-continuations/actor-lwt.wast/10.print +++ b/tests/snapshots/local/typed-continuations/actor-lwt.wast/10.print @@ -1,9 +1,9 @@ (module $lwt (type $func (;0;) (func)) (type $cont (;1;) (cont $func)) - (type (;2;) (func (param (ref 1)))) + (type (;2;) (func (param (ref $cont)))) (tag $yield (;0;) (type $func)) - (tag $fork (;1;) (type 2) (param (ref 1))) + (tag $fork (;1;) (type 2) (param (ref $cont))) (export "yield" (tag 0)) (export "fork" (tag 1)) ) diff --git a/tests/snapshots/local/typed-continuations/actor-lwt.wast/12.print b/tests/snapshots/local/typed-continuations/actor-lwt.wast/12.print index 3d330c35d6..174db6d7df 100644 --- a/tests/snapshots/local/typed-continuations/actor-lwt.wast/12.print +++ b/tests/snapshots/local/typed-continuations/actor-lwt.wast/12.print @@ -2,18 +2,18 @@ (type $func (;0;) (func)) (type $cont (;1;) (cont $func)) (type (;2;) (func (result i32))) - (type (;3;) (func (result (ref null 1)))) - (type (;4;) (func (param (ref 1)))) + (type (;3;) (func (result (ref null $cont)))) + (type (;4;) (func (param (ref $cont)))) (func $queue-empty (;0;) (type 2) (result i32) global.get $qfront global.get $qback i32.eq ) - (func $dequeue (;1;) (type 3) (result (ref null 1)) + (func $dequeue (;1;) (type 3) (result (ref null $cont)) (local $i i32) call $queue-empty if ;; label = @1 - ref.null 1 + ref.null $cont return end global.get $qfront @@ -25,7 +25,7 @@ local.get $i table.get $queue ) - (func $enqueue (;2;) (type 4) (param $k (ref 1)) + (func $enqueue (;2;) (type 4) (param $k (ref $cont)) global.get $qback table.size $queue i32.eq @@ -34,7 +34,7 @@ global.get $qdelta i32.lt_u if ;; label = @2 - ref.null 1 + ref.null $cont global.get $qdelta table.grow $queue drop @@ -48,7 +48,7 @@ global.get $qback table.copy global.get $qback - ref.null 1 + ref.null $cont global.get $qfront table.fill $queue i32.const 0 @@ -63,7 +63,7 @@ i32.add global.set $qback ) - (table $queue (;0;) 0 (ref null 1)) + (table $queue (;0;) 0 (ref null $cont)) (global $qdelta (;0;) i32 i32.const 10) (global $qback (;1;) (mut i32) i32.const 0) (global $qfront (;2;) (mut i32) i32.const 0) diff --git a/tests/snapshots/local/typed-continuations/actor-lwt.wast/14.print b/tests/snapshots/local/typed-continuations/actor-lwt.wast/14.print index a8e8251920..577a54faa2 100644 --- a/tests/snapshots/local/typed-continuations/actor-lwt.wast/14.print +++ b/tests/snapshots/local/typed-continuations/actor-lwt.wast/14.print @@ -1,16 +1,16 @@ (module $scheduler (type $func (;0;) (func)) (type $cont (;1;) (cont $func)) - (type (;2;) (func (param (ref 1)))) + (type (;2;) (func (param (ref $cont)))) (type (;3;) (func (result i32))) - (type (;4;) (func (result (ref null 1)))) - (type (;5;) (func (result (ref 1) (ref 1)))) + (type (;4;) (func (result (ref null $cont)))) + (type (;5;) (func (result (ref $cont) (ref $cont)))) (import "lwt" "yield" (tag $yield (;0;) (type $func))) - (import "lwt" "fork" (tag $fork (;1;) (type 2) (param (ref 1)))) + (import "lwt" "fork" (tag $fork (;1;) (type 2) (param (ref $cont)))) (import "queue" "queue-empty" (func $queue-empty (;0;) (type 3))) (import "queue" "dequeue" (func $dequeue (;1;) (type 4))) (import "queue" "enqueue" (func $enqueue (;2;) (type 2))) - (func $run (;3;) (type 2) (param $main (ref 1)) + (func $run (;3;) (type 2) (param $main (ref $cont)) local.get $main call $enqueue loop $l @@ -18,8 +18,8 @@ if ;; label = @2 return end - block $on_yield (result (ref 1)) - block $on_fork (type 5) (result (ref 1) (ref 1)) + block $on_yield (result (ref $cont)) + block $on_fork (type 5) (result (ref $cont) (ref $cont)) call $dequeue resume $cont (tag $yield $on_yield)(tag $fork $on_fork) br $l diff --git a/tests/snapshots/local/typed-continuations/actor-lwt.wast/18.print b/tests/snapshots/local/typed-continuations/actor-lwt.wast/18.print index fc232f9347..8319f12900 100644 --- a/tests/snapshots/local/typed-continuations/actor-lwt.wast/18.print +++ b/tests/snapshots/local/typed-continuations/actor-lwt.wast/18.print @@ -3,19 +3,19 @@ (type $cont (;1;) (cont $func)) (type $i-func (;2;) (func (param i32))) (type $i-cont (;3;) (cont $i-func)) - (type $ic-func (;4;) (func (param i32 (ref 1)))) + (type $ic-func (;4;) (func (param i32 (ref $cont)))) (type $ic-cont (;5;) (cont $ic-func)) - (type (;6;) (func (param (ref 1)))) + (type (;6;) (func (param (ref $cont)))) (type (;7;) (func (param i32) (result i32))) (type (;8;) (func (result i32))) (type (;9;) (func (param i32 i32))) - (type (;10;) (func (result (ref null 1)))) - (type (;11;) (func (param (ref 1)) (result i32))) - (type (;12;) (func (result (ref 1) (ref 3)))) - (type (;13;) (func (result i32 i32 (ref 1)))) + (type (;10;) (func (result (ref null $cont)))) + (type (;11;) (func (param (ref $cont)) (result i32))) + (type (;12;) (func (result (ref $cont) (ref $i-cont)))) + (type (;13;) (func (result i32 i32 (ref $cont)))) (import "spectest" "print_i32" (func $log (;0;) (type $i-func))) (import "lwt" "yield" (tag $yield (;0;) (type $func))) - (import "lwt" "fork" (tag $fork (;1;) (type 6) (param (ref 1)))) + (import "lwt" "fork" (tag $fork (;1;) (type 6) (param (ref $cont)))) (import "mailboxes" "init" (func $init (;1;) (type $func))) (import "mailboxes" "empty-mb" (func $empty-mb (;2;) (type 7))) (import "mailboxes" "new-mb" (func $new-mb (;3;) (type 8))) @@ -25,16 +25,16 @@ (import "queue" "dequeue" (func $dequeue (;7;) (type 10))) (import "queue" "enqueue" (func $enqueue (;8;) (type 6))) (import "actor" "self" (tag $self (;2;) (type 8) (result i32))) - (import "actor" "spawn" (tag $spawn (;3;) (type 11) (param (ref 1)) (result i32))) + (import "actor" "spawn" (tag $spawn (;3;) (type 11) (param (ref $cont)) (result i32))) (import "actor" "send" (tag $send (;4;) (type 9) (param i32 i32))) (import "actor" "recv" (tag $recv (;5;) (type 8) (result i32))) - (func $actk (;9;) (type $ic-func) (param $mine i32) (param $nextk (ref 1)) - (local $ik (ref 3)) (local $k (ref 1)) (local $you (ref 1)) (local $yours i32) + (func $actk (;9;) (type $ic-func) (param $mine i32) (param $nextk (ref $cont)) + (local $ik (ref $i-cont)) (local $k (ref $cont)) (local $you (ref $cont)) (local $yours i32) loop $l - block $on_self (result (ref 3)) - block $on_spawn (type 12) (result (ref 1) (ref 3)) - block $on_send (type 13) (result i32 i32 (ref 1)) - block $on_recv (result (ref 3)) + block $on_self (result (ref $i-cont)) + block $on_spawn (type 12) (result (ref $cont) (ref $i-cont)) + block $on_send (type 13) (result i32 i32 (ref $cont)) + block $on_recv (result (ref $i-cont)) local.get $nextk resume $cont (tag $self $on_self)(tag $spawn $on_spawn)(tag $send $on_send)(tag $recv $on_recv) return @@ -85,7 +85,7 @@ br $l end ) - (func $act (;10;) (type 6) (param $k (ref 1)) + (func $act (;10;) (type 6) (param $k (ref $cont)) call $init call $new-mb local.get $k diff --git a/tests/snapshots/local/typed-continuations/actor-lwt.wast/2.print b/tests/snapshots/local/typed-continuations/actor-lwt.wast/2.print index 52c7698cdb..860aa79ab8 100644 --- a/tests/snapshots/local/typed-continuations/actor-lwt.wast/2.print +++ b/tests/snapshots/local/typed-continuations/actor-lwt.wast/2.print @@ -4,10 +4,10 @@ (type $i-func (;2;) (func (param i32))) (type $i-cont (;3;) (cont $i-func)) (type (;4;) (func (result i32))) - (type (;5;) (func (param (ref 1)) (result i32))) + (type (;5;) (func (param (ref $cont)) (result i32))) (type (;6;) (func (param i32 i32))) (import "actor" "self" (tag $self (;0;) (type 4) (result i32))) - (import "actor" "spawn" (tag $spawn (;1;) (type 5) (param (ref 1)) (result i32))) + (import "actor" "spawn" (tag $spawn (;1;) (type 5) (param (ref $cont)) (result i32))) (import "actor" "send" (tag $send (;2;) (type 6) (param i32 i32))) (import "actor" "recv" (tag $recv (;3;) (type 4) (result i32))) (import "spectest" "print_i32" (func $log (;0;) (type $i-func))) diff --git a/tests/snapshots/local/typed-continuations/actor-lwt.wast/20.print b/tests/snapshots/local/typed-continuations/actor-lwt.wast/20.print index 0c961f666d..5e04bf8916 100644 --- a/tests/snapshots/local/typed-continuations/actor-lwt.wast/20.print +++ b/tests/snapshots/local/typed-continuations/actor-lwt.wast/20.print @@ -1,11 +1,11 @@ (module $actor-scheduler (type $func (;0;) (func)) (type $cont (;1;) (cont $func)) - (type $cont-func (;2;) (func (param (ref 1)))) + (type $cont-func (;2;) (func (param (ref $cont)))) (type $cont-cont (;3;) (cont $cont-func)) (import "actor-as-lwt" "act" (func $act (;0;) (type $cont-func))) (import "scheduler" "run" (func $scheduler (;1;) (type $cont-func))) - (func $run-actor (;2;) (type $cont-func) (param $k (ref 1)) + (func $run-actor (;2;) (type $cont-func) (param $k (ref $cont)) local.get $k ref.func $act cont.new $cont-cont diff --git a/tests/snapshots/local/typed-continuations/actor-lwt.wast/22.print b/tests/snapshots/local/typed-continuations/actor-lwt.wast/22.print index e873adf26f..a8e23f58bf 100644 --- a/tests/snapshots/local/typed-continuations/actor-lwt.wast/22.print +++ b/tests/snapshots/local/typed-continuations/actor-lwt.wast/22.print @@ -3,7 +3,7 @@ (type $cont (;1;) (cont $func)) (type $i-func (;2;) (func (param i32))) (type $i-cont (;3;) (cont $i-func)) - (type (;4;) (func (param (ref 1)))) + (type (;4;) (func (param (ref $cont)))) (import "actor-scheduler" "run-actor" (func $run-actor (;0;) (type 4))) (import "chain" "chain" (func $chain (;1;) (type $i-func))) (func $run-chain (;2;) (type $i-func) (param $n i32) diff --git a/tests/snapshots/local/typed-continuations/actor-lwt.wast/4.print b/tests/snapshots/local/typed-continuations/actor-lwt.wast/4.print index c33cffcdcd..142e222369 100644 --- a/tests/snapshots/local/typed-continuations/actor-lwt.wast/4.print +++ b/tests/snapshots/local/typed-continuations/actor-lwt.wast/4.print @@ -3,19 +3,19 @@ (type $cont (;1;) (cont $func)) (type (;2;) (func (param i32))) (type (;3;) (func (result i32))) - (type (;4;) (func (result (ref null 1)))) - (type (;5;) (func (param (ref 1)))) + (type (;4;) (func (result (ref null $cont)))) + (type (;5;) (func (param (ref $cont)))) (import "spectest" "print_i32" (func $log (;0;) (type 2))) (func $queue-empty-k (;1;) (type 3) (result i32) global.get $qfront-k global.get $qback-k i32.eq ) - (func $dequeue-k (;2;) (type 4) (result (ref null 1)) + (func $dequeue-k (;2;) (type 4) (result (ref null $cont)) (local $i i32) call $queue-empty-k if ;; label = @1 - ref.null 1 + ref.null $cont return end global.get $qfront-k @@ -27,7 +27,7 @@ local.get $i table.get $queue ) - (func $enqueue-k (;3;) (type 5) (param $k (ref 1)) + (func $enqueue-k (;3;) (type 5) (param $k (ref $cont)) global.get $qback-k table.size $queue i32.eq @@ -36,7 +36,7 @@ global.get $qdelta i32.lt_u if ;; label = @2 - ref.null 1 + ref.null $cont global.get $qdelta table.grow $queue drop @@ -50,7 +50,7 @@ global.get $qback-k table.copy global.get $qback-k - ref.null 1 + ref.null $cont global.get $qfront-k table.fill $queue i32.const 0 @@ -136,7 +136,7 @@ i32.add global.set $qback-mb ) - (table $queue (;0;) 0 (ref null 1)) + (table $queue (;0;) 0 (ref null $cont)) (memory (;0;) 1) (tag $too-many-mailboxes (;0;) (type $func)) (global $qdelta (;0;) i32 i32.const 10) diff --git a/tests/snapshots/local/typed-continuations/actor-lwt.wast/8.print b/tests/snapshots/local/typed-continuations/actor-lwt.wast/8.print index 52c7698cdb..860aa79ab8 100644 --- a/tests/snapshots/local/typed-continuations/actor-lwt.wast/8.print +++ b/tests/snapshots/local/typed-continuations/actor-lwt.wast/8.print @@ -4,10 +4,10 @@ (type $i-func (;2;) (func (param i32))) (type $i-cont (;3;) (cont $i-func)) (type (;4;) (func (result i32))) - (type (;5;) (func (param (ref 1)) (result i32))) + (type (;5;) (func (param (ref $cont)) (result i32))) (type (;6;) (func (param i32 i32))) (import "actor" "self" (tag $self (;0;) (type 4) (result i32))) - (import "actor" "spawn" (tag $spawn (;1;) (type 5) (param (ref 1)) (result i32))) + (import "actor" "spawn" (tag $spawn (;1;) (type 5) (param (ref $cont)) (result i32))) (import "actor" "send" (tag $send (;2;) (type 6) (param i32 i32))) (import "actor" "recv" (tag $recv (;3;) (type 4) (result i32))) (import "spectest" "print_i32" (func $log (;0;) (type $i-func))) diff --git a/tests/snapshots/local/typed-continuations/actor.wast/0.print b/tests/snapshots/local/typed-continuations/actor.wast/0.print index 116aa3ace8..4d6caf0965 100644 --- a/tests/snapshots/local/typed-continuations/actor.wast/0.print +++ b/tests/snapshots/local/typed-continuations/actor.wast/0.print @@ -2,10 +2,10 @@ (type $func (;0;) (func)) (type $cont (;1;) (cont $func)) (type (;2;) (func (result i32))) - (type (;3;) (func (param (ref 1)) (result i32))) + (type (;3;) (func (param (ref $cont)) (result i32))) (type (;4;) (func (param i32 i32))) (tag $self (;0;) (type 2) (result i32)) - (tag $spawn (;1;) (type 3) (param (ref 1)) (result i32)) + (tag $spawn (;1;) (type 3) (param (ref $cont)) (result i32)) (tag $send (;2;) (type 4) (param i32 i32)) (tag $recv (;3;) (type 2) (result i32)) (export "self" (tag 0)) diff --git a/tests/snapshots/local/typed-continuations/actor.wast/10.print b/tests/snapshots/local/typed-continuations/actor.wast/10.print index 3f0a5de3fc..7fa45fac66 100644 --- a/tests/snapshots/local/typed-continuations/actor.wast/10.print +++ b/tests/snapshots/local/typed-continuations/actor.wast/10.print @@ -3,7 +3,7 @@ (type $cont (;1;) (cont $func)) (type $i-func (;2;) (func (param i32))) (type $i-cont (;3;) (cont $i-func)) - (type (;4;) (func (param (ref null 1)))) + (type (;4;) (func (param (ref null $cont)))) (import "spectest" "print_i32" (func $log (;0;) (type $i-func))) (import "scheduler" "run" (func $act (;1;) (type 4))) (import "chain" "chain" (func $chain (;2;) (type $i-func))) diff --git a/tests/snapshots/local/typed-continuations/actor.wast/2.print b/tests/snapshots/local/typed-continuations/actor.wast/2.print index 52c7698cdb..860aa79ab8 100644 --- a/tests/snapshots/local/typed-continuations/actor.wast/2.print +++ b/tests/snapshots/local/typed-continuations/actor.wast/2.print @@ -4,10 +4,10 @@ (type $i-func (;2;) (func (param i32))) (type $i-cont (;3;) (cont $i-func)) (type (;4;) (func (result i32))) - (type (;5;) (func (param (ref 1)) (result i32))) + (type (;5;) (func (param (ref $cont)) (result i32))) (type (;6;) (func (param i32 i32))) (import "actor" "self" (tag $self (;0;) (type 4) (result i32))) - (import "actor" "spawn" (tag $spawn (;1;) (type 5) (param (ref 1)) (result i32))) + (import "actor" "spawn" (tag $spawn (;1;) (type 5) (param (ref $cont)) (result i32))) (import "actor" "send" (tag $send (;2;) (type 6) (param i32 i32))) (import "actor" "recv" (tag $recv (;3;) (type 4) (result i32))) (import "spectest" "print_i32" (func $log (;0;) (type $i-func))) diff --git a/tests/snapshots/local/typed-continuations/actor.wast/4.print b/tests/snapshots/local/typed-continuations/actor.wast/4.print index c33cffcdcd..142e222369 100644 --- a/tests/snapshots/local/typed-continuations/actor.wast/4.print +++ b/tests/snapshots/local/typed-continuations/actor.wast/4.print @@ -3,19 +3,19 @@ (type $cont (;1;) (cont $func)) (type (;2;) (func (param i32))) (type (;3;) (func (result i32))) - (type (;4;) (func (result (ref null 1)))) - (type (;5;) (func (param (ref 1)))) + (type (;4;) (func (result (ref null $cont)))) + (type (;5;) (func (param (ref $cont)))) (import "spectest" "print_i32" (func $log (;0;) (type 2))) (func $queue-empty-k (;1;) (type 3) (result i32) global.get $qfront-k global.get $qback-k i32.eq ) - (func $dequeue-k (;2;) (type 4) (result (ref null 1)) + (func $dequeue-k (;2;) (type 4) (result (ref null $cont)) (local $i i32) call $queue-empty-k if ;; label = @1 - ref.null 1 + ref.null $cont return end global.get $qfront-k @@ -27,7 +27,7 @@ local.get $i table.get $queue ) - (func $enqueue-k (;3;) (type 5) (param $k (ref 1)) + (func $enqueue-k (;3;) (type 5) (param $k (ref $cont)) global.get $qback-k table.size $queue i32.eq @@ -36,7 +36,7 @@ global.get $qdelta i32.lt_u if ;; label = @2 - ref.null 1 + ref.null $cont global.get $qdelta table.grow $queue drop @@ -50,7 +50,7 @@ global.get $qback-k table.copy global.get $qback-k - ref.null 1 + ref.null $cont global.get $qfront-k table.fill $queue i32.const 0 @@ -136,7 +136,7 @@ i32.add global.set $qback-mb ) - (table $queue (;0;) 0 (ref null 1)) + (table $queue (;0;) 0 (ref null $cont)) (memory (;0;) 1) (tag $too-many-mailboxes (;0;) (type $func)) (global $qdelta (;0;) i32 i32.const 10) diff --git a/tests/snapshots/local/typed-continuations/actor.wast/8.print b/tests/snapshots/local/typed-continuations/actor.wast/8.print index d27baf094d..a5f9b8b115 100644 --- a/tests/snapshots/local/typed-continuations/actor.wast/8.print +++ b/tests/snapshots/local/typed-continuations/actor.wast/8.print @@ -3,18 +3,18 @@ (type $cont (;1;) (cont $func)) (type $i-func (;2;) (func (param i32))) (type $i-cont (;3;) (cont $i-func)) - (type $i-cont-func (;4;) (func (param (ref 3)))) + (type $i-cont-func (;4;) (func (param (ref $i-cont)))) (type $i-cont-cont (;5;) (cont $i-cont-func)) (type (;6;) (func (param i32) (result i32))) (type (;7;) (func (result i32))) (type (;8;) (func (param i32 i32))) - (type (;9;) (func (result (ref null 1)))) - (type (;10;) (func (param (ref 1)))) - (type (;11;) (func (param (ref 1)) (result i32))) - (type (;12;) (func (param (ref 3)) (result (ref 1)))) - (type (;13;) (func (param (ref null 1)))) - (type (;14;) (func (result (ref 1) (ref 3)))) - (type (;15;) (func (result i32 i32 (ref 1)))) + (type (;9;) (func (result (ref null $cont)))) + (type (;10;) (func (param (ref $cont)))) + (type (;11;) (func (param (ref $cont)) (result i32))) + (type (;12;) (func (param (ref $i-cont)) (result (ref $cont)))) + (type (;13;) (func (param (ref null $cont)))) + (type (;14;) (func (result (ref $cont) (ref $i-cont)))) + (type (;15;) (func (result i32 i32 (ref $cont)))) (import "spectest" "print_i32" (func $log (;0;) (type $i-func))) (import "mailboxes" "init" (func $init (;1;) (type $func))) (import "mailboxes" "empty-mb" (func $empty-mb (;2;) (type 6))) @@ -26,10 +26,10 @@ (import "queue" "dequeue-k" (func $dequeue-k (;8;) (type 9))) (import "queue" "enqueue-k" (func $enqueue-k (;9;) (type 10))) (import "actor" "self" (tag $self (;0;) (type 7) (result i32))) - (import "actor" "spawn" (tag $spawn (;1;) (type 11) (param (ref 1)) (result i32))) + (import "actor" "spawn" (tag $spawn (;1;) (type 11) (param (ref $cont)) (result i32))) (import "actor" "send" (tag $send (;2;) (type 8) (param i32 i32))) (import "actor" "recv" (tag $recv (;3;) (type 7) (result i32))) - (func $recv-againf (;10;) (type $i-cont-func) (param $ik (ref 3)) + (func $recv-againf (;10;) (type $i-cont-func) (param $ik (ref $i-cont)) (local $res i32) suspend $recv local.set $res @@ -37,14 +37,14 @@ local.get $ik resume $i-cont ) - (func $recv-again (;11;) (type 12) (param $ik (ref 3)) (result (ref 1)) + (func $recv-again (;11;) (type 12) (param $ik (ref $i-cont)) (result (ref $cont)) local.get $ik ref.func $recv-againf cont.new $i-cont-cont cont.bind $i-cont-cont $cont ) - (func $run (;12;) (type 13) (param $nextk (ref null 1)) - (local $mine i32) (local $ik (ref 3)) (local $k (ref 1)) (local $you (ref 1)) (local $yours i32) + (func $run (;12;) (type 13) (param $nextk (ref null $cont)) + (local $mine i32) (local $ik (ref $i-cont)) (local $k (ref $cont)) (local $you (ref $cont)) (local $yours i32) call $init call $new-mb local.set $mine @@ -54,10 +54,10 @@ if ;; label = @2 return end - block $on_self (result (ref 3)) - block $on_spawn (type 14) (result (ref 1) (ref 3)) - block $on_send (type 15) (result i32 i32 (ref 1)) - block $on_recv (result (ref 3)) + block $on_self (result (ref $i-cont)) + block $on_spawn (type 14) (result (ref $cont) (ref $i-cont)) + block $on_send (type 15) (result i32 i32 (ref $cont)) + block $on_recv (result (ref $i-cont)) local.get $nextk resume $cont (tag $self $on_self)(tag $spawn $on_spawn)(tag $send $on_send)(tag $recv $on_recv) call $dequeue-mb diff --git a/tests/snapshots/local/typed-continuations/async-await.wast/0.print b/tests/snapshots/local/typed-continuations/async-await.wast/0.print index ccb3f504ec..508cb34083 100644 --- a/tests/snapshots/local/typed-continuations/async-await.wast/0.print +++ b/tests/snapshots/local/typed-continuations/async-await.wast/0.print @@ -3,11 +3,11 @@ (type $i-cont (;1;) (cont $i-func)) (type (;2;) (func)) (type (;3;) (func (param i32 i32))) - (type (;4;) (func (param (ref 1)) (result i32))) + (type (;4;) (func (param (ref $i-cont)) (result i32))) (type (;5;) (func (param i32) (result i32))) (tag $yield (;0;) (type 2)) (tag $fulfill (;1;) (type 3) (param i32 i32)) - (tag $async (;2;) (type 4) (param (ref 1)) (result i32)) + (tag $async (;2;) (type 4) (param (ref $i-cont)) (result i32)) (tag $await (;3;) (type 5) (param i32) (result i32)) (export "yield" (tag 0)) (export "fulfill" (tag 1)) diff --git a/tests/snapshots/local/typed-continuations/async-await.wast/10.print b/tests/snapshots/local/typed-continuations/async-await.wast/10.print index ffe91171da..53913b49ff 100644 --- a/tests/snapshots/local/typed-continuations/async-await.wast/10.print +++ b/tests/snapshots/local/typed-continuations/async-await.wast/10.print @@ -1,7 +1,7 @@ (module (type $func (;0;) (func)) (type $cont (;1;) (cont $func)) - (type (;2;) (func (param (ref null 1)))) + (type (;2;) (func (param (ref null $cont)))) (type (;3;) (func (param i32))) (import "scheduler" "run" (func $scheduler (;0;) (type 2))) (import "spectest" "print_i32" (func $log (;1;) (type 3))) diff --git a/tests/snapshots/local/typed-continuations/async-await.wast/2.print b/tests/snapshots/local/typed-continuations/async-await.wast/2.print index 33062d0690..02d1a3e556 100644 --- a/tests/snapshots/local/typed-continuations/async-await.wast/2.print +++ b/tests/snapshots/local/typed-continuations/async-await.wast/2.print @@ -5,11 +5,11 @@ (type $iii-cont (;3;) (cont $iii-fun)) (type (;4;) (func)) (type (;5;) (func (param i32 i32))) - (type (;6;) (func (param (ref 1)) (result i32))) + (type (;6;) (func (param (ref $i-cont)) (result i32))) (type (;7;) (func (param i32) (result i32))) (import "async-await" "yield" (tag $yield (;0;) (type 4))) (import "async-await" "fulfill" (tag $fulfill (;1;) (type 5) (param i32 i32))) - (import "async-await" "async" (tag $async (;2;) (type 6) (param (ref 1)) (result i32))) + (import "async-await" "async" (tag $async (;2;) (type 6) (param (ref $i-cont)) (result i32))) (import "async-await" "await" (tag $await (;3;) (type 7) (param i32) (result i32))) (import "spectest" "print_i32" (func $log (;0;) (type $i-func))) (func $sum (;1;) (type $iii-fun) (param $i i32) (param $j i32) (param $p i32) diff --git a/tests/snapshots/local/typed-continuations/async-await.wast/4.print b/tests/snapshots/local/typed-continuations/async-await.wast/4.print index 21160b6021..39a709e616 100644 --- a/tests/snapshots/local/typed-continuations/async-await.wast/4.print +++ b/tests/snapshots/local/typed-continuations/async-await.wast/4.print @@ -2,18 +2,18 @@ (type $func (;0;) (func)) (type $cont (;1;) (cont $func)) (type (;2;) (func (result i32))) - (type (;3;) (func (result (ref null 1)))) - (type (;4;) (func (param (ref null 1)))) + (type (;3;) (func (result (ref null $cont)))) + (type (;4;) (func (param (ref null $cont)))) (func $queue-empty (;0;) (type 2) (result i32) global.get $qfront global.get $qback i32.eq ) - (func $dequeue (;1;) (type 3) (result (ref null 1)) + (func $dequeue (;1;) (type 3) (result (ref null $cont)) (local $i i32) call $queue-empty if ;; label = @1 - ref.null 1 + ref.null $cont return end global.get $qfront @@ -25,7 +25,7 @@ local.get $i table.get $queue ) - (func $enqueue (;2;) (type 4) (param $k (ref null 1)) + (func $enqueue (;2;) (type 4) (param $k (ref null $cont)) global.get $qback table.size $queue i32.eq @@ -34,7 +34,7 @@ global.get $qdelta i32.lt_u if ;; label = @2 - ref.null 1 + ref.null $cont global.get $qdelta table.grow $queue drop @@ -48,7 +48,7 @@ global.get $qback table.copy global.get $qback - ref.null 1 + ref.null $cont global.get $qfront table.fill $queue i32.const 0 @@ -63,7 +63,7 @@ i32.add global.set $qback ) - (table $queue (;0;) 0 (ref null 1)) + (table $queue (;0;) 0 (ref null $cont)) (global $qdelta (;0;) i32 i32.const 10) (global $qback (;1;) (mut i32) i32.const 0) (global $qfront (;2;) (mut i32) i32.const 0) diff --git a/tests/snapshots/local/typed-continuations/async-await.wast/6.print b/tests/snapshots/local/typed-continuations/async-await.wast/6.print index a00cf880e3..6b2c7d0d21 100644 --- a/tests/snapshots/local/typed-continuations/async-await.wast/6.print +++ b/tests/snapshots/local/typed-continuations/async-await.wast/6.print @@ -5,8 +5,8 @@ (type $i-cont (;3;) (cont $i-func)) (type (;4;) (func (result i32))) (type (;5;) (func (param i32) (result i32))) - (type (;6;) (func (param i32 (ref 3)))) - (type (;7;) (func (param i32 i32) (result (ref null 1)))) + (type (;6;) (func (param i32 (ref $i-cont)))) + (type (;7;) (func (param i32 i32) (result (ref null $cont)))) (func $new (;0;) (type 4) (result i32) (local $offset i32) (local $p i32) global.get $num-promises @@ -22,7 +22,7 @@ i32.mul local.set $offset local.get $p - ref.null 3 + ref.null $i-cont table.set $observers local.get $offset i32.const -1 @@ -54,7 +54,7 @@ local.get $offset i32.load ) - (func $await (;3;) (type 6) (param $p i32) (param $k (ref 3)) + (func $await (;3;) (type 6) (param $p i32) (param $k (ref $i-cont)) local.get $p table.get $observers ref.is_null @@ -66,8 +66,8 @@ throw $too-many-observers end ) - (func $fulfill (;4;) (type 7) (param $p i32) (param $v i32) (result (ref null 1)) - (local $offset i32) (local $k (ref null 3)) + (func $fulfill (;4;) (type 7) (param $p i32) (param $v i32) (result (ref null $cont)) + (local $offset i32) (local $k (ref null $i-cont)) local.get $p i32.const 4 i32.mul @@ -81,7 +81,7 @@ local.get $k ref.is_null if ;; label = @1 - ref.null 1 + ref.null $cont return end local.get $v @@ -89,7 +89,7 @@ cont.bind $i-cont $cont return ) - (table $observers (;0;) 1000 (ref null 3)) + (table $observers (;0;) 1000 (ref null $i-cont)) (memory (;0;) 1) (tag $too-many-promises (;0;) (type $func)) (tag $too-many-observers (;1;) (type $func)) diff --git a/tests/snapshots/local/typed-continuations/async-await.wast/8.print b/tests/snapshots/local/typed-continuations/async-await.wast/8.print index 739cb4be8a..4cdb25fdca 100644 --- a/tests/snapshots/local/typed-continuations/async-await.wast/8.print +++ b/tests/snapshots/local/typed-continuations/async-await.wast/8.print @@ -4,19 +4,19 @@ (type $i-func (;2;) (func (param i32))) (type $i-cont (;3;) (cont $i-func)) (type (;4;) (func (param i32 i32))) - (type (;5;) (func (param (ref 3)) (result i32))) + (type (;5;) (func (param (ref $i-cont)) (result i32))) (type (;6;) (func (param i32) (result i32))) (type (;7;) (func (result i32))) - (type (;8;) (func (result (ref null 1)))) - (type (;9;) (func (param (ref null 1)))) - (type (;10;) (func (param i32 (ref 3)))) - (type (;11;) (func (param i32 i32) (result (ref null 1)))) - (type (;12;) (func (result i32 i32 (ref 1)))) - (type (;13;) (func (result (ref 3) (ref 3)))) - (type (;14;) (func (result i32 (ref 3)))) + (type (;8;) (func (result (ref null $cont)))) + (type (;9;) (func (param (ref null $cont)))) + (type (;10;) (func (param i32 (ref $i-cont)))) + (type (;11;) (func (param i32 i32) (result (ref null $cont)))) + (type (;12;) (func (result i32 i32 (ref $cont)))) + (type (;13;) (func (result (ref $i-cont) (ref $i-cont)))) + (type (;14;) (func (result i32 (ref $i-cont)))) (import "async-await" "yield" (tag $yield (;0;) (type $func))) (import "async-await" "fulfill" (tag $fulfill (;1;) (type 4) (param i32 i32))) - (import "async-await" "async" (tag $async (;2;) (type 5) (param (ref 3)) (result i32))) + (import "async-await" "async" (tag $async (;2;) (type 5) (param (ref $i-cont)) (result i32))) (import "async-await" "await" (tag $await (;3;) (type 6) (param i32) (result i32))) (import "queue" "queue-empty" (func $queue-empty (;0;) (type 7))) (import "queue" "dequeue" (func $dequeue (;1;) (type 8))) @@ -26,18 +26,18 @@ (import "promise" "read" (func $promise-value (;5;) (type 6))) (import "promise" "await" (func $await-promise (;6;) (type 10))) (import "promise" "fulfill" (func $fulfill-promise (;7;) (type 11))) - (func $run (;8;) (type 9) (param $nextk (ref null 1)) - (local $p i32) (local $v i32) (local $ik (ref 3)) (local $ak (ref 3)) (local $k (ref null 1)) + (func $run (;8;) (type 9) (param $nextk (ref null $cont)) + (local $p i32) (local $v i32) (local $ik (ref $i-cont)) (local $ak (ref $i-cont)) (local $k (ref null $cont)) loop $l local.get $nextk ref.is_null if ;; label = @2 return end - block $on_yield (result (ref 1)) - block $on_fulfill (type 12) (result i32 i32 (ref 1)) - block $on_async (type 13) (result (ref 3) (ref 3)) - block $on_await (type 14) (result i32 (ref 3)) + block $on_yield (result (ref $cont)) + block $on_fulfill (type 12) (result i32 i32 (ref $cont)) + block $on_async (type 13) (result (ref $i-cont) (ref $i-cont)) + block $on_await (type 14) (result i32 (ref $i-cont)) local.get $nextk resume $cont (tag $yield $on_yield)(tag $fulfill $on_fulfill)(tag $async $on_async)(tag $await $on_await) call $dequeue diff --git a/tests/snapshots/local/typed-continuations/cont.wast/0.print b/tests/snapshots/local/typed-continuations/cont.wast/0.print index 030831847b..7d99d617c1 100644 --- a/tests/snapshots/local/typed-continuations/cont.wast/0.print +++ b/tests/snapshots/local/typed-continuations/cont.wast/0.print @@ -1,7 +1,7 @@ (module (type $f1 (;0;) (func)) (type $k1 (;1;) (cont $f1)) - (type (;2;) (func (param (ref 1)))) + (type (;2;) (func (param (ref $k1)))) (func $f1 (;0;) (type $f1) suspend $e1 ) @@ -11,7 +11,7 @@ resume $k1 ) (func (;2;) (type $f1) - block $h (result (ref 1)) + block $h (result (ref $k1)) ref.func $f1 cont.new $k1 resume $k1 (tag $e2 $h) @@ -20,7 +20,7 @@ drop ) (func (;3;) (type $f1) - block $h (result (ref 1)) + block $h (result (ref $k1)) ref.func $f1 cont.new $k1 resume $k1 (tag $e1 $h) @@ -32,7 +32,7 @@ throw $exn ) (func (;5;) (type $f1) - block $h (result (ref 1)) + block $h (result (ref $k1)) ref.func $f2 cont.new $k1 resume $k1 (tag $e1 $h) @@ -41,7 +41,7 @@ drop ) (func (;6;) (type $f1) - block $h (result (ref 1)) + block $h (result (ref $k1)) ref.func $f1 cont.new $k1 resume $k1 (tag $e1 $h) @@ -58,7 +58,7 @@ suspend $e1 ) (func (;9;) (type $f1) - block $h (result (ref 1)) + block $h (result (ref $k1)) ref.func $f3 cont.new $k1 resume $k1 (tag $e1 $h) @@ -71,14 +71,14 @@ suspend $e1 suspend $e1 ) - (func $nl1 (;12;) (type 2) (param $k (ref 1)) + (func $nl1 (;12;) (type 2) (param $k (ref $k1)) local.get $k resume $k1 local.get $k resume $k1 ) - (func $nl2 (;13;) (type 2) (param $k (ref 1)) - block $h (result (ref 1)) + (func $nl2 (;13;) (type 2) (param $k (ref $k1)) + block $h (result (ref $k1)) local.get $k resume $k1 (tag $e1 $h) unreachable @@ -87,15 +87,15 @@ resume $k1 unreachable ) - (func $nl3 (;14;) (type 2) (param $k (ref 1)) - (local $k' (ref null 1)) - block $h1 (result (ref 1)) + (func $nl3 (;14;) (type 2) (param $k (ref $k1)) + (local $k' (ref null $k1)) + block $h1 (result (ref $k1)) local.get $k resume $k1 (tag $e1 $h1) unreachable end local.set $k' - block $h2 (result (ref 1)) + block $h2 (result (ref $k1)) local.get $k' resume $k1 (tag $e1 $h2) unreachable @@ -104,7 +104,7 @@ resume $k1 unreachable ) - (func $nl4 (;15;) (type 2) (param $k (ref 1)) + (func $nl4 (;15;) (type 2) (param $k (ref $k1)) local.get $k cont.bind $k1 $k1 drop diff --git a/tests/snapshots/local/typed-continuations/cont.wast/12.print b/tests/snapshots/local/typed-continuations/cont.wast/12.print index 72366a2522..993fa8f6e2 100644 --- a/tests/snapshots/local/typed-continuations/cont.wast/12.print +++ b/tests/snapshots/local/typed-continuations/cont.wast/12.print @@ -2,12 +2,12 @@ (type $f (;0;) (func (param i32) (result i32))) (type $k (;1;) (cont $f)) (type (;2;) (func (result i32))) - (type (;3;) (func (param i32 (ref 1)) (result i32))) - (type (;4;) (func (result i32 (ref 1)))) - (func $runner (;0;) (type 3) (param $s i32) (param $k (ref 1)) (result i32) + (type (;3;) (func (param i32 (ref $k)) (result i32))) + (type (;4;) (func (result i32 (ref $k)))) + (func $runner (;0;) (type 3) (param $s i32) (param $k (ref $k)) (result i32) loop $loop - block $on_get (result (ref 1)) - block $on_set (type 4) (result i32 (ref 1)) + block $on_get (result (ref $k)) + block $on_set (type 4) (result i32 (ref $k)) local.get $s local.get $k resume $k (tag $get $on_get)(tag $set $on_set) diff --git a/tests/snapshots/local/typed-continuations/cont.wast/14.print b/tests/snapshots/local/typed-continuations/cont.wast/14.print index ff058fa3b2..a092cecb73 100644 --- a/tests/snapshots/local/typed-continuations/cont.wast/14.print +++ b/tests/snapshots/local/typed-continuations/cont.wast/14.print @@ -5,8 +5,8 @@ (type $cont (;3;) (cont $geny)) (type (;4;) (func (param i64) (result i32))) (type (;5;) (func (param i64 i64) (result i64))) - (type (;6;) (func (param i64 (ref 2)) (result i64 (ref 3)))) - (type (;7;) (func (param i64 (ref 3)))) + (type (;6;) (func (param i64 (ref $cont0)) (result i64 (ref $cont)))) + (type (;7;) (func (param i64 (ref $cont)))) (func $dummy (;0;) (type $gen) (param i64)) (func $gen (;1;) (type $gen) (param $i i64) loop $l @@ -24,15 +24,15 @@ end ) (func (;2;) (type 5) (param $i i64) (param $j i64) (result i64) - (local $sum i64) (local $n i64) (local $k (ref null 3)) + (local $sum i64) (local $n i64) (local $k (ref null $cont)) local.get $i ref.func $gen cont.new $cont0 - block $on_first_yield (type 6) (param i64 (ref 2)) (result i64 (ref 3)) + block $on_first_yield (type 6) (param i64 (ref $cont0)) (result i64 (ref $cont)) resume $cont0 (tag $yield $on_first_yield) unreachable end - loop $on_yield (type 7) (param i64 (ref 3)) + loop $on_yield (type 7) (param i64 (ref $cont)) local.set $k local.set $n local.get $sum @@ -49,7 +49,7 @@ return ) (tag $yield (;0;) (type 4) (param i64) (result i32)) - (global $hook (;0;) (mut (ref 0)) ref.func $dummy) + (global $hook (;0;) (mut (ref $gen)) ref.func $dummy) (export "hook" (global $hook)) (export "start" (func $gen)) (export "sum" (func 2)) diff --git a/tests/snapshots/local/typed-continuations/cont.wast/21.print b/tests/snapshots/local/typed-continuations/cont.wast/21.print index 07250de023..b32f34422c 100644 --- a/tests/snapshots/local/typed-continuations/cont.wast/21.print +++ b/tests/snapshots/local/typed-continuations/cont.wast/21.print @@ -1,20 +1,20 @@ (module $scheduler (type $proc (;0;) (func)) (type $cont (;1;) (cont $proc)) - (type (;2;) (func (param (ref 1)))) + (type (;2;) (func (param (ref $cont)))) (type (;3;) (func (result i32))) - (type (;4;) (func (result (ref null 1)))) - (type (;5;) (func (result (ref 1) (ref 1)))) + (type (;4;) (func (result (ref null $cont)))) + (type (;5;) (func (result (ref $cont) (ref $cont)))) (func $queue-empty (;0;) (type 3) (result i32) global.get $qfront global.get $qback i32.eq ) - (func $dequeue (;1;) (type 4) (result (ref null 1)) + (func $dequeue (;1;) (type 4) (result (ref null $cont)) (local $i i32) call $queue-empty if ;; label = @1 - ref.null 1 + ref.null $cont return end global.get $qfront @@ -26,7 +26,7 @@ local.get $i table.get $queue ) - (func $enqueue (;2;) (type 2) (param $k (ref 1)) + (func $enqueue (;2;) (type 2) (param $k (ref $cont)) global.get $qback table.size $queue i32.eq @@ -35,7 +35,7 @@ global.get $qdelta i32.lt_u if ;; label = @2 - ref.null 1 + ref.null $cont global.get $qdelta table.grow $queue drop @@ -49,7 +49,7 @@ global.get $qback table.copy global.get $qback - ref.null 1 + ref.null $cont global.get $qfront table.fill $queue i32.const 0 @@ -64,7 +64,7 @@ i32.add global.set $qback ) - (func $scheduler (;3;) (type 2) (param $main (ref 1)) + (func $scheduler (;3;) (type 2) (param $main (ref $cont)) local.get $main call $enqueue loop $l @@ -72,8 +72,8 @@ if ;; label = @2 return end - block $on_yield (result (ref 1)) - block $on_spawn (type 5) (result (ref 1) (ref 1)) + block $on_yield (result (ref $cont)) + block $on_spawn (type 5) (result (ref $cont) (ref $cont)) call $dequeue resume $cont (tag $yield $on_yield)(tag $spawn $on_spawn) br $l @@ -86,9 +86,9 @@ br $l end ) - (table $queue (;0;) 0 (ref null 1)) + (table $queue (;0;) 0 (ref null $cont)) (tag $yield (;0;) (type $proc)) - (tag $spawn (;1;) (type 2) (param (ref 1))) + (tag $spawn (;1;) (type 2) (param (ref $cont))) (global $qdelta (;0;) i32 i32.const 10) (global $qback (;1;) (mut i32) i32.const 0) (global $qfront (;2;) (mut i32) i32.const 0) diff --git a/tests/snapshots/local/typed-continuations/cont.wast/23.print b/tests/snapshots/local/typed-continuations/cont.wast/23.print index d6fe4e43c3..a48ac33655 100644 --- a/tests/snapshots/local/typed-continuations/cont.wast/23.print +++ b/tests/snapshots/local/typed-continuations/cont.wast/23.print @@ -3,10 +3,10 @@ (type $pproc (;1;) (func (param i32))) (type $cont (;2;) (cont $proc)) (type $pcont (;3;) (cont $pproc)) - (type (;4;) (func (param (ref 2)))) + (type (;4;) (func (param (ref $cont)))) (type (;5;) (func (param i32 i32))) (import "scheduler" "yield" (tag $yield (;0;) (type $proc))) - (import "scheduler" "spawn" (tag $spawn (;1;) (type 4) (param (ref 2)))) + (import "scheduler" "spawn" (tag $spawn (;1;) (type 4) (param (ref $cont)))) (import "scheduler" "scheduler" (func $scheduler (;0;) (type 4))) (import "spectest" "print_i32" (func $log (;1;) (type $pproc))) (func $main (;2;) (type $proc) diff --git a/tests/snapshots/local/typed-continuations/cont.wast/29.print b/tests/snapshots/local/typed-continuations/cont.wast/29.print index bb15bc8ce5..8e8b6a3933 100644 --- a/tests/snapshots/local/typed-continuations/cont.wast/29.print +++ b/tests/snapshots/local/typed-continuations/cont.wast/29.print @@ -4,14 +4,14 @@ (type $pproc (;2;) (func (param i64 i64))) (type $cont (;3;) (cont $proc)) (type $pcont (;4;) (cont $pproc)) - (type (;5;) (func (param (ref 3)))) + (type (;5;) (func (param (ref $cont)))) (type (;6;) (func (param i64 i64) (result i64))) (import "spectest" "print_i64" (func $log (;0;) (type $ghook))) (import "scheduler" "yield" (tag $syield (;0;) (type $proc))) - (import "scheduler" "spawn" (tag $spawn (;1;) (type 5) (param (ref 3)))) + (import "scheduler" "spawn" (tag $spawn (;1;) (type 5) (param (ref $cont)))) (import "scheduler" "scheduler" (func $scheduler (;1;) (type 5))) (import "generator" "sum" (func $gsum (;2;) (type 6))) - (import "generator" "hook" (global $ghook (;0;) (mut (ref 0)))) + (import "generator" "hook" (global $ghook (;0;) (mut (ref $ghook)))) (func $syield (;3;) (type $ghook) (param $i i64) local.get $i call $log diff --git a/tests/snapshots/local/typed-continuations/cont.wast/31.print b/tests/snapshots/local/typed-continuations/cont.wast/31.print index 1c9e2f4f2a..3a1c8ffcb0 100644 --- a/tests/snapshots/local/typed-continuations/cont.wast/31.print +++ b/tests/snapshots/local/typed-continuations/cont.wast/31.print @@ -15,7 +15,7 @@ local.get 5 ) (func (;1;) (type 6) (result i32 i32 i32 i32 i32 i32) - (local $k6 (ref null 5)) (local $k4 (ref null 4)) (local $k2 (ref null 3)) + (local $k6 (ref null $k6)) (local $k4 (ref null $k4)) (local $k2 (ref null $k2)) ref.func $f cont.new $k6 local.set $k6 diff --git a/tests/snapshots/local/typed-continuations/cont.wast/33.print b/tests/snapshots/local/typed-continuations/cont.wast/33.print index 17ea845e77..f75fab74fe 100644 --- a/tests/snapshots/local/typed-continuations/cont.wast/33.print +++ b/tests/snapshots/local/typed-continuations/cont.wast/33.print @@ -13,8 +13,8 @@ suspend $e ) (func (;1;) (type $f0) (result i32 i32 i32 i32 i32 i32 i32) - (local $k6 (ref null 7)) (local $k4 (ref null 6)) (local $k2 (ref null 5)) - block $l (result (ref 7)) + (local $k6 (ref null $k6)) (local $k4 (ref null $k4)) (local $k2 (ref null $k2)) + block $l (result (ref $k6)) ref.func $f cont.new $k0 resume $k0 (tag $e $l) diff --git a/tests/snapshots/local/typed-continuations/cont_canonicalisation.wast/0.print b/tests/snapshots/local/typed-continuations/cont_canonicalisation.wast/0.print index 2e088ec9db..3f3bdc0eac 100644 --- a/tests/snapshots/local/typed-continuations/cont_canonicalisation.wast/0.print +++ b/tests/snapshots/local/typed-continuations/cont_canonicalisation.wast/0.print @@ -5,11 +5,11 @@ (type $f3_t (;3;) (func (param i32) (result i32))) (type $f3_ct (;4;) (cont $f3_t)) (type (;5;) (func (result i32))) - (type (;6;) (func (result i32 (ref 2)))) + (type (;6;) (func (result i32 (ref $res_int_to_int)))) (func $test_case_4 (;0;) (type 5) (result i32) - block $on_e3 (type 6) (result i32 (ref 2)) + block $on_e3 (type 6) (result i32 (ref $res_int_to_int)) i32.const 49 - ref.null 4 + ref.null $f3_ct resume $f3_ct (tag $e3_int_to_int $on_e3) unreachable end diff --git a/tests/snapshots/local/typed-continuations/cont_new.wast/0.print b/tests/snapshots/local/typed-continuations/cont_new.wast/0.print index 00ccd8ee4d..e1b72f0a33 100644 --- a/tests/snapshots/local/typed-continuations/cont_new.wast/0.print +++ b/tests/snapshots/local/typed-continuations/cont_new.wast/0.print @@ -1,10 +1,10 @@ (module (type $ft (;0;) (func)) (type $ct (;1;) (cont $ft)) - (type (;2;) (func (result (ref 1)))) + (type (;2;) (func (result (ref $ct)))) (type (;3;) (func (result i32))) (func $noop (;0;) (type $ft)) - (func $make-cont (;1;) (type 2) (result (ref 1)) + (func $make-cont (;1;) (type 2) (result (ref $ct)) ref.func $noop cont.new $ct ) diff --git a/tests/snapshots/local/typed-continuations/cont_suspend.wast/0.print b/tests/snapshots/local/typed-continuations/cont_suspend.wast/0.print index 1bda9fa052..841cdb8578 100644 --- a/tests/snapshots/local/typed-continuations/cont_suspend.wast/0.print +++ b/tests/snapshots/local/typed-continuations/cont_suspend.wast/0.print @@ -12,7 +12,7 @@ (func (;2;) (type 3) (result i32) i32.const 1 call $print - block $on_h (result (ref 1)) + block $on_h (result (ref $ct)) ref.func $f cont.new $ct resume $ct (tag $h $on_h) diff --git a/tests/snapshots/local/typed-continuations/fun-actor-lwt.wast/0.print b/tests/snapshots/local/typed-continuations/fun-actor-lwt.wast/0.print index 116aa3ace8..4d6caf0965 100644 --- a/tests/snapshots/local/typed-continuations/fun-actor-lwt.wast/0.print +++ b/tests/snapshots/local/typed-continuations/fun-actor-lwt.wast/0.print @@ -2,10 +2,10 @@ (type $func (;0;) (func)) (type $cont (;1;) (cont $func)) (type (;2;) (func (result i32))) - (type (;3;) (func (param (ref 1)) (result i32))) + (type (;3;) (func (param (ref $cont)) (result i32))) (type (;4;) (func (param i32 i32))) (tag $self (;0;) (type 2) (result i32)) - (tag $spawn (;1;) (type 3) (param (ref 1)) (result i32)) + (tag $spawn (;1;) (type 3) (param (ref $cont)) (result i32)) (tag $send (;2;) (type 4) (param i32 i32)) (tag $recv (;3;) (type 2) (result i32)) (export "self" (tag 0)) diff --git a/tests/snapshots/local/typed-continuations/fun-actor-lwt.wast/12.print b/tests/snapshots/local/typed-continuations/fun-actor-lwt.wast/12.print index 59444cf31e..d7a53550b1 100644 --- a/tests/snapshots/local/typed-continuations/fun-actor-lwt.wast/12.print +++ b/tests/snapshots/local/typed-continuations/fun-actor-lwt.wast/12.print @@ -3,34 +3,34 @@ (type $cont (;1;) (cont $func)) (type $i-func (;2;) (func (param i32))) (type $i-cont (;3;) (cont $i-func)) - (type $icont-func (;4;) (func (param i32 (ref 1)))) + (type $icont-func (;4;) (func (param i32 (ref $cont)))) (type $icont-cont (;5;) (cont $icont-func)) - (type (;6;) (func (param (ref 1)))) + (type (;6;) (func (param (ref $cont)))) (type (;7;) (func (param i32) (result i32))) (type (;8;) (func (result i32))) (type (;9;) (func (param i32 i32))) - (type (;10;) (func (param (ref 1)) (result i32))) - (type (;11;) (func (param i32 i32 (ref 3)))) - (type (;12;) (func (result (ref 1) (ref 3)))) - (type (;13;) (func (result i32 i32 (ref 1)))) + (type (;10;) (func (param (ref $cont)) (result i32))) + (type (;11;) (func (param i32 i32 (ref $i-cont)))) + (type (;12;) (func (result (ref $cont) (ref $i-cont)))) + (type (;13;) (func (result i32 i32 (ref $cont)))) (import "spectest" "print_i32" (func $log (;0;) (type $i-func))) (import "lwt" "yield" (tag $yield (;0;) (type $func))) - (import "lwt" "fork" (tag $fork (;1;) (type 6) (param (ref 1)))) + (import "lwt" "fork" (tag $fork (;1;) (type 6) (param (ref $cont)))) (import "mailboxes" "init" (func $init (;1;) (type $func))) (import "mailboxes" "empty-mb" (func $empty-mb (;2;) (type 7))) (import "mailboxes" "new-mb" (func $new-mb (;3;) (type 8))) (import "mailboxes" "send-to-mb" (func $send-to-mb (;4;) (type 9))) (import "mailboxes" "recv-from-mb" (func $recv-from-mb (;5;) (type 7))) (import "actor" "self" (tag $self (;2;) (type 8) (result i32))) - (import "actor" "spawn" (tag $spawn (;3;) (type 10) (param (ref 1)) (result i32))) + (import "actor" "spawn" (tag $spawn (;3;) (type 10) (param (ref $cont)) (result i32))) (import "actor" "send" (tag $send (;4;) (type 9) (param i32 i32))) (import "actor" "recv" (tag $recv (;5;) (type 8) (result i32))) - (func $act-res (;6;) (type 11) (param $mine i32) (param $res i32) (param $ik (ref 3)) - (local $yours i32) (local $k (ref 1)) (local $you (ref 1)) - block $on_self (result (ref 3)) - block $on_spawn (type 12) (result (ref 1) (ref 3)) - block $on_send (type 13) (result i32 i32 (ref 1)) - block $on_recv (result (ref 3)) + (func $act-res (;6;) (type 11) (param $mine i32) (param $res i32) (param $ik (ref $i-cont)) + (local $yours i32) (local $k (ref $cont)) (local $you (ref $cont)) + block $on_self (result (ref $i-cont)) + block $on_spawn (type 12) (result (ref $cont) (ref $i-cont)) + block $on_send (type 13) (result i32 i32 (ref $cont)) + block $on_recv (result (ref $i-cont)) local.get $res local.get $ik resume $i-cont (tag $self $on_self)(tag $spawn $on_spawn)(tag $send $on_send)(tag $recv $on_recv) @@ -80,12 +80,12 @@ local.get $ik return_call $act-res ) - (func $act-nullary (;7;) (type $icont-func) (param $mine i32) (param $k (ref 1)) - (local $res i32) (local $ik (ref 3)) (local $you (ref 1)) (local $yours i32) - block $on_self (result (ref 3)) - block $on_spawn (type 12) (result (ref 1) (ref 3)) - block $on_send (type 13) (result i32 i32 (ref 1)) - block $on_recv (result (ref 3)) + (func $act-nullary (;7;) (type $icont-func) (param $mine i32) (param $k (ref $cont)) + (local $res i32) (local $ik (ref $i-cont)) (local $you (ref $cont)) (local $yours i32) + block $on_self (result (ref $i-cont)) + block $on_spawn (type 12) (result (ref $cont) (ref $i-cont)) + block $on_send (type 13) (result i32 i32 (ref $cont)) + block $on_recv (result (ref $i-cont)) local.get $k resume $cont (tag $self $on_self)(tag $spawn $on_spawn)(tag $send $on_send)(tag $recv $on_recv) return @@ -134,7 +134,7 @@ local.get $ik return_call $act-res ) - (func $act (;8;) (type 6) (param $k (ref 1)) + (func $act (;8;) (type 6) (param $k (ref $cont)) call $init call $new-mb local.get $k diff --git a/tests/snapshots/local/typed-continuations/fun-actor-lwt.wast/14.print b/tests/snapshots/local/typed-continuations/fun-actor-lwt.wast/14.print index 76d8613f23..3a744fdf7d 100644 --- a/tests/snapshots/local/typed-continuations/fun-actor-lwt.wast/14.print +++ b/tests/snapshots/local/typed-continuations/fun-actor-lwt.wast/14.print @@ -1,12 +1,12 @@ (module $actor-scheduler (type $func (;0;) (func)) (type $cont (;1;) (cont $func)) - (type $cont-func (;2;) (func (param (ref 1)))) + (type $cont-func (;2;) (func (param (ref $cont)))) (type $cont-cont (;3;) (cont $cont-func)) - (type $f-func (;4;) (func (param (ref 0)))) + (type $f-func (;4;) (func (param (ref $func)))) (import "actor-as-lwt" "act" (func $act (;0;) (type $cont-func))) (import "scheduler" "run" (func $scheduler (;1;) (type $cont-func))) - (func $run-actor (;2;) (type $cont-func) (param $k (ref 1)) + (func $run-actor (;2;) (type $cont-func) (param $k (ref $cont)) local.get $k ref.func $act cont.new $cont-cont diff --git a/tests/snapshots/local/typed-continuations/fun-actor-lwt.wast/16.print b/tests/snapshots/local/typed-continuations/fun-actor-lwt.wast/16.print index e873adf26f..a8e23f58bf 100644 --- a/tests/snapshots/local/typed-continuations/fun-actor-lwt.wast/16.print +++ b/tests/snapshots/local/typed-continuations/fun-actor-lwt.wast/16.print @@ -3,7 +3,7 @@ (type $cont (;1;) (cont $func)) (type $i-func (;2;) (func (param i32))) (type $i-cont (;3;) (cont $i-func)) - (type (;4;) (func (param (ref 1)))) + (type (;4;) (func (param (ref $cont)))) (import "actor-scheduler" "run-actor" (func $run-actor (;0;) (type 4))) (import "chain" "chain" (func $chain (;1;) (type $i-func))) (func $run-chain (;2;) (type $i-func) (param $n i32) diff --git a/tests/snapshots/local/typed-continuations/fun-actor-lwt.wast/2.print b/tests/snapshots/local/typed-continuations/fun-actor-lwt.wast/2.print index 79d1c9e5d5..2ebbec6045 100644 --- a/tests/snapshots/local/typed-continuations/fun-actor-lwt.wast/2.print +++ b/tests/snapshots/local/typed-continuations/fun-actor-lwt.wast/2.print @@ -4,10 +4,10 @@ (type $i-func (;2;) (func (param i32))) (type $i-cont (;3;) (cont $i-func)) (type (;4;) (func (result i32))) - (type (;5;) (func (param (ref 1)) (result i32))) + (type (;5;) (func (param (ref $cont)) (result i32))) (type (;6;) (func (param i32 i32))) (import "actor" "self" (tag $self (;0;) (type 4) (result i32))) - (import "actor" "spawn" (tag $spawn (;1;) (type 5) (param (ref 1)) (result i32))) + (import "actor" "spawn" (tag $spawn (;1;) (type 5) (param (ref $cont)) (result i32))) (import "actor" "send" (tag $send (;2;) (type 6) (param i32 i32))) (import "actor" "recv" (tag $recv (;3;) (type 4) (result i32))) (import "spectest" "print_i32" (func $log (;0;) (type $i-func))) diff --git a/tests/snapshots/local/typed-continuations/fun-actor-lwt.wast/4.print b/tests/snapshots/local/typed-continuations/fun-actor-lwt.wast/4.print index 6dec107915..6fd482867c 100644 --- a/tests/snapshots/local/typed-continuations/fun-actor-lwt.wast/4.print +++ b/tests/snapshots/local/typed-continuations/fun-actor-lwt.wast/4.print @@ -1,9 +1,9 @@ (module $lwt (type $func (;0;) (func)) (type $cont (;1;) (cont $func)) - (type (;2;) (func (param (ref 1)))) + (type (;2;) (func (param (ref $cont)))) (tag $yield (;0;) (type $func)) - (tag $fork (;1;) (type 2) (param (ref 1))) + (tag $fork (;1;) (type 2) (param (ref $cont))) (export "yield" (tag 0)) (export "fork" (tag 1)) ) diff --git a/tests/snapshots/local/typed-continuations/fun-actor-lwt.wast/6.print b/tests/snapshots/local/typed-continuations/fun-actor-lwt.wast/6.print index 3d330c35d6..174db6d7df 100644 --- a/tests/snapshots/local/typed-continuations/fun-actor-lwt.wast/6.print +++ b/tests/snapshots/local/typed-continuations/fun-actor-lwt.wast/6.print @@ -2,18 +2,18 @@ (type $func (;0;) (func)) (type $cont (;1;) (cont $func)) (type (;2;) (func (result i32))) - (type (;3;) (func (result (ref null 1)))) - (type (;4;) (func (param (ref 1)))) + (type (;3;) (func (result (ref null $cont)))) + (type (;4;) (func (param (ref $cont)))) (func $queue-empty (;0;) (type 2) (result i32) global.get $qfront global.get $qback i32.eq ) - (func $dequeue (;1;) (type 3) (result (ref null 1)) + (func $dequeue (;1;) (type 3) (result (ref null $cont)) (local $i i32) call $queue-empty if ;; label = @1 - ref.null 1 + ref.null $cont return end global.get $qfront @@ -25,7 +25,7 @@ local.get $i table.get $queue ) - (func $enqueue (;2;) (type 4) (param $k (ref 1)) + (func $enqueue (;2;) (type 4) (param $k (ref $cont)) global.get $qback table.size $queue i32.eq @@ -34,7 +34,7 @@ global.get $qdelta i32.lt_u if ;; label = @2 - ref.null 1 + ref.null $cont global.get $qdelta table.grow $queue drop @@ -48,7 +48,7 @@ global.get $qback table.copy global.get $qback - ref.null 1 + ref.null $cont global.get $qfront table.fill $queue i32.const 0 @@ -63,7 +63,7 @@ i32.add global.set $qback ) - (table $queue (;0;) 0 (ref null 1)) + (table $queue (;0;) 0 (ref null $cont)) (global $qdelta (;0;) i32 i32.const 10) (global $qback (;1;) (mut i32) i32.const 0) (global $qfront (;2;) (mut i32) i32.const 0) diff --git a/tests/snapshots/local/typed-continuations/fun-actor-lwt.wast/8.print b/tests/snapshots/local/typed-continuations/fun-actor-lwt.wast/8.print index a8e8251920..577a54faa2 100644 --- a/tests/snapshots/local/typed-continuations/fun-actor-lwt.wast/8.print +++ b/tests/snapshots/local/typed-continuations/fun-actor-lwt.wast/8.print @@ -1,16 +1,16 @@ (module $scheduler (type $func (;0;) (func)) (type $cont (;1;) (cont $func)) - (type (;2;) (func (param (ref 1)))) + (type (;2;) (func (param (ref $cont)))) (type (;3;) (func (result i32))) - (type (;4;) (func (result (ref null 1)))) - (type (;5;) (func (result (ref 1) (ref 1)))) + (type (;4;) (func (result (ref null $cont)))) + (type (;5;) (func (result (ref $cont) (ref $cont)))) (import "lwt" "yield" (tag $yield (;0;) (type $func))) - (import "lwt" "fork" (tag $fork (;1;) (type 2) (param (ref 1)))) + (import "lwt" "fork" (tag $fork (;1;) (type 2) (param (ref $cont)))) (import "queue" "queue-empty" (func $queue-empty (;0;) (type 3))) (import "queue" "dequeue" (func $dequeue (;1;) (type 4))) (import "queue" "enqueue" (func $enqueue (;2;) (type 2))) - (func $run (;3;) (type 2) (param $main (ref 1)) + (func $run (;3;) (type 2) (param $main (ref $cont)) local.get $main call $enqueue loop $l @@ -18,8 +18,8 @@ if ;; label = @2 return end - block $on_yield (result (ref 1)) - block $on_fork (type 5) (result (ref 1) (ref 1)) + block $on_yield (result (ref $cont)) + block $on_fork (type 5) (result (ref $cont) (ref $cont)) call $dequeue resume $cont (tag $yield $on_yield)(tag $fork $on_fork) br $l diff --git a/tests/snapshots/local/typed-continuations/fun-lwt.wast/0.print b/tests/snapshots/local/typed-continuations/fun-lwt.wast/0.print index 6dec107915..6fd482867c 100644 --- a/tests/snapshots/local/typed-continuations/fun-lwt.wast/0.print +++ b/tests/snapshots/local/typed-continuations/fun-lwt.wast/0.print @@ -1,9 +1,9 @@ (module $lwt (type $func (;0;) (func)) (type $cont (;1;) (cont $func)) - (type (;2;) (func (param (ref 1)))) + (type (;2;) (func (param (ref $cont)))) (tag $yield (;0;) (type $func)) - (tag $fork (;1;) (type 2) (param (ref 1))) + (tag $fork (;1;) (type 2) (param (ref $cont))) (export "yield" (tag 0)) (export "fork" (tag 1)) ) diff --git a/tests/snapshots/local/typed-continuations/fun-lwt.wast/2.print b/tests/snapshots/local/typed-continuations/fun-lwt.wast/2.print index 0065af1e77..346cda1a08 100644 --- a/tests/snapshots/local/typed-continuations/fun-lwt.wast/2.print +++ b/tests/snapshots/local/typed-continuations/fun-lwt.wast/2.print @@ -1,10 +1,10 @@ (module $example (type $func (;0;) (func)) (type $cont (;1;) (cont $func)) - (type (;2;) (func (param (ref 1)))) + (type (;2;) (func (param (ref $cont)))) (type (;3;) (func (param i32))) (import "lwt" "yield" (tag $yield (;0;) (type $func))) - (import "lwt" "fork" (tag $fork (;1;) (type 2) (param (ref 1)))) + (import "lwt" "fork" (tag $fork (;1;) (type 2) (param (ref $cont)))) (import "spectest" "print_i32" (func $log (;0;) (type 3))) (func $main (;1;) (type $func) i32.const 0 diff --git a/tests/snapshots/local/typed-continuations/fun-lwt.wast/4.print b/tests/snapshots/local/typed-continuations/fun-lwt.wast/4.print index 3d330c35d6..174db6d7df 100644 --- a/tests/snapshots/local/typed-continuations/fun-lwt.wast/4.print +++ b/tests/snapshots/local/typed-continuations/fun-lwt.wast/4.print @@ -2,18 +2,18 @@ (type $func (;0;) (func)) (type $cont (;1;) (cont $func)) (type (;2;) (func (result i32))) - (type (;3;) (func (result (ref null 1)))) - (type (;4;) (func (param (ref 1)))) + (type (;3;) (func (result (ref null $cont)))) + (type (;4;) (func (param (ref $cont)))) (func $queue-empty (;0;) (type 2) (result i32) global.get $qfront global.get $qback i32.eq ) - (func $dequeue (;1;) (type 3) (result (ref null 1)) + (func $dequeue (;1;) (type 3) (result (ref null $cont)) (local $i i32) call $queue-empty if ;; label = @1 - ref.null 1 + ref.null $cont return end global.get $qfront @@ -25,7 +25,7 @@ local.get $i table.get $queue ) - (func $enqueue (;2;) (type 4) (param $k (ref 1)) + (func $enqueue (;2;) (type 4) (param $k (ref $cont)) global.get $qback table.size $queue i32.eq @@ -34,7 +34,7 @@ global.get $qdelta i32.lt_u if ;; label = @2 - ref.null 1 + ref.null $cont global.get $qdelta table.grow $queue drop @@ -48,7 +48,7 @@ global.get $qback table.copy global.get $qback - ref.null 1 + ref.null $cont global.get $qfront table.fill $queue i32.const 0 @@ -63,7 +63,7 @@ i32.add global.set $qback ) - (table $queue (;0;) 0 (ref null 1)) + (table $queue (;0;) 0 (ref null $cont)) (global $qdelta (;0;) i32 i32.const 10) (global $qback (;1;) (mut i32) i32.const 0) (global $qfront (;2;) (mut i32) i32.const 0) diff --git a/tests/snapshots/local/typed-continuations/fun-lwt.wast/6.print b/tests/snapshots/local/typed-continuations/fun-lwt.wast/6.print index bb66311dc5..0dcd4c7a77 100644 --- a/tests/snapshots/local/typed-continuations/fun-lwt.wast/6.print +++ b/tests/snapshots/local/typed-continuations/fun-lwt.wast/6.print @@ -1,24 +1,24 @@ (module $scheduler (type $func (;0;) (func)) (type $cont (;1;) (cont $func)) - (type (;2;) (func (param (ref 1)))) + (type (;2;) (func (param (ref $cont)))) (type (;3;) (func (result i32))) - (type (;4;) (func (result (ref null 1)))) - (type (;5;) (func (param (ref null 1)))) - (type (;6;) (func (result (ref 1) (ref 1)))) + (type (;4;) (func (result (ref null $cont)))) + (type (;5;) (func (param (ref null $cont)))) + (type (;6;) (func (result (ref $cont) (ref $cont)))) (import "lwt" "yield" (tag $yield (;0;) (type $func))) - (import "lwt" "fork" (tag $fork (;1;) (type 2) (param (ref 1)))) + (import "lwt" "fork" (tag $fork (;1;) (type 2) (param (ref $cont)))) (import "queue" "queue-empty" (func $queue-empty (;0;) (type 3))) (import "queue" "dequeue" (func $dequeue (;1;) (type 4))) (import "queue" "enqueue" (func $enqueue (;2;) (type 2))) - (func $sync (;3;) (type 5) (param $nextk (ref null 1)) + (func $sync (;3;) (type 5) (param $nextk (ref null $cont)) local.get $nextk ref.is_null if ;; label = @1 return end - block $on_yield (result (ref 1)) - block $on_fork (type 6) (result (ref 1) (ref 1)) + block $on_yield (result (ref $cont)) + block $on_fork (type 6) (result (ref $cont) (ref $cont)) local.get $nextk resume $cont (tag $yield $on_yield)(tag $fork $on_fork) call $dequeue @@ -31,14 +31,14 @@ end return_call $sync ) - (func $kt (;4;) (type 5) (param $nextk (ref null 1)) + (func $kt (;4;) (type 5) (param $nextk (ref null $cont)) local.get $nextk ref.is_null if ;; label = @1 return end - block $on_yield (result (ref 1)) - block $on_fork (type 6) (result (ref 1) (ref 1)) + block $on_yield (result (ref $cont)) + block $on_fork (type 6) (result (ref $cont) (ref $cont)) local.get $nextk resume $cont (tag $yield $on_yield)(tag $fork $on_fork) call $dequeue @@ -53,14 +53,14 @@ call $dequeue return_call $tk ) - (func $tk (;5;) (type 5) (param $nextk (ref null 1)) + (func $tk (;5;) (type 5) (param $nextk (ref null $cont)) local.get $nextk ref.is_null if ;; label = @1 return end - block $on_yield (result (ref 1)) - block $on_fork (type 6) (result (ref 1) (ref 1)) + block $on_yield (result (ref $cont)) + block $on_fork (type 6) (result (ref $cont) (ref $cont)) local.get $nextk resume $cont (tag $yield $on_yield)(tag $fork $on_fork) call $dequeue @@ -73,14 +73,14 @@ call $dequeue return_call $kt ) - (func $ykt (;6;) (type 5) (param $nextk (ref null 1)) + (func $ykt (;6;) (type 5) (param $nextk (ref null $cont)) local.get $nextk ref.is_null if ;; label = @1 return end - block $on_yield (result (ref 1)) - block $on_fork (type 6) (result (ref 1) (ref 1)) + block $on_yield (result (ref $cont)) + block $on_fork (type 6) (result (ref $cont) (ref $cont)) local.get $nextk resume $cont (tag $yield $on_yield)(tag $fork $on_fork) call $dequeue @@ -95,15 +95,15 @@ call $dequeue return_call $ykt ) - (func $ytk (;7;) (type 5) (param $nextk (ref null 1)) - (local $k (ref 1)) + (func $ytk (;7;) (type 5) (param $nextk (ref null $cont)) + (local $k (ref $cont)) local.get $nextk ref.is_null if ;; label = @1 return end - block $on_yield (result (ref 1)) - block $on_fork (type 6) (result (ref 1) (ref 1)) + block $on_yield (result (ref $cont)) + block $on_fork (type 6) (result (ref $cont) (ref $cont)) local.get $nextk resume $cont (tag $yield $on_yield)(tag $fork $on_fork) call $dequeue diff --git a/tests/snapshots/local/typed-continuations/fun-lwt.wast/8.print b/tests/snapshots/local/typed-continuations/fun-lwt.wast/8.print index 2d2fe2b32a..39639d49fd 100644 --- a/tests/snapshots/local/typed-continuations/fun-lwt.wast/8.print +++ b/tests/snapshots/local/typed-continuations/fun-lwt.wast/8.print @@ -1,7 +1,7 @@ (module (type $func (;0;) (func)) (type $cont (;1;) (cont $func)) - (type (;2;) (func (param (ref null 1)))) + (type (;2;) (func (param (ref null $cont)))) (type (;3;) (func (param i32))) (import "scheduler" "sync" (func $scheduler-sync (;0;) (type 2))) (import "scheduler" "kt" (func $scheduler-kt (;1;) (type 2))) diff --git a/tests/snapshots/local/typed-continuations/fun-pipes.wast/0.print b/tests/snapshots/local/typed-continuations/fun-pipes.wast/0.print index ce0192f91b..5004dc0aad 100644 --- a/tests/snapshots/local/typed-continuations/fun-pipes.wast/0.print +++ b/tests/snapshots/local/typed-continuations/fun-pipes.wast/0.print @@ -4,12 +4,12 @@ (type $producer (;2;) (cont $pfun)) (type $consumer (;3;) (cont $cfun)) (type (;4;) (func (param i32))) - (type (;5;) (func (param i32 (ref 2) (ref 3)))) - (type (;6;) (func (param (ref 3) (ref 2)))) - (type (;7;) (func (result i32 (ref 2)))) - (type (;8;) (func (param (ref 2) (ref 3)))) - (func $piper (;0;) (type 5) (param $n i32) (param $p (ref 2)) (param $c (ref 3)) - block $on-receive (result (ref 3)) + (type (;5;) (func (param i32 (ref $producer) (ref $consumer)))) + (type (;6;) (func (param (ref $consumer) (ref $producer)))) + (type (;7;) (func (result i32 (ref $producer)))) + (type (;8;) (func (param (ref $producer) (ref $consumer)))) + (func $piper (;0;) (type 5) (param $n i32) (param $p (ref $producer)) (param $c (ref $consumer)) + block $on-receive (result (ref $consumer)) local.get $n local.get $c resume $consumer (tag $receive $on-receive) @@ -20,9 +20,9 @@ local.get $p return_call $copiper ) - (func $copiper (;1;) (type 6) (param $c (ref 3)) (param $p (ref 2)) + (func $copiper (;1;) (type 6) (param $c (ref $consumer)) (param $p (ref $producer)) (local $n i32) - block $on-send (type 7) (result i32 (ref 2)) + block $on-send (type 7) (result i32 (ref $producer)) local.get $p resume $producer (tag $send $on-send) return @@ -34,7 +34,7 @@ local.get $c return_call $piper ) - (func $pipe (;2;) (type 8) (param $p (ref 2)) (param $c (ref 3)) + (func $pipe (;2;) (type 8) (param $p (ref $producer)) (param $c (ref $consumer)) i32.const -1 local.get $p local.get $c diff --git a/tests/snapshots/local/typed-continuations/fun-pipes.wast/2.print b/tests/snapshots/local/typed-continuations/fun-pipes.wast/2.print index ceb54a755a..e26ddafa46 100644 --- a/tests/snapshots/local/typed-continuations/fun-pipes.wast/2.print +++ b/tests/snapshots/local/typed-continuations/fun-pipes.wast/2.print @@ -4,7 +4,7 @@ (type $producer (;2;) (cont $pfun)) (type $consumer (;3;) (cont $cfun)) (type (;4;) (func (param i32))) - (type (;5;) (func (param (ref 2) (ref 3)))) + (type (;5;) (func (param (ref $producer) (ref $consumer)))) (import "pipes" "send" (tag $send (;0;) (type 4) (param i32))) (import "pipes" "receive" (tag $receive (;1;) (type $pfun) (result i32))) (import "pipes" "pipe" (func $pipe (;0;) (type 5))) diff --git a/tests/snapshots/local/typed-continuations/fun-state.wast/0.print b/tests/snapshots/local/typed-continuations/fun-state.wast/0.print index f466ce2deb..d475de0061 100644 --- a/tests/snapshots/local/typed-continuations/fun-state.wast/0.print +++ b/tests/snapshots/local/typed-continuations/fun-state.wast/0.print @@ -4,12 +4,12 @@ (type $gk (;2;) (cont $gf)) (type $sk (;3;) (cont $sf)) (type (;4;) (func (param i32))) - (type (;5;) (func (param (ref 2) i32) (result i32))) - (type (;6;) (func (result i32 (ref 3)))) - (type (;7;) (func (param i32 (ref 3)) (result i32))) - (func $getting (;0;) (type 5) (param $k (ref 2)) (param $s i32) (result i32) - block $on_get (result (ref 2)) - block $on_set (type 6) (result i32 (ref 3)) + (type (;5;) (func (param (ref $gk) i32) (result i32))) + (type (;6;) (func (result i32 (ref $sk)))) + (type (;7;) (func (param i32 (ref $sk)) (result i32))) + (func $getting (;0;) (type 5) (param $k (ref $gk)) (param $s i32) (result i32) + block $on_get (result (ref $gk)) + block $on_set (type 6) (result i32 (ref $sk)) local.get $s local.get $k resume $gk (tag $get $on_get)(tag $set $on_set) @@ -20,9 +20,9 @@ local.get $s return_call $getting ) - (func $setting (;1;) (type 7) (param $s i32) (param $k (ref 3)) (result i32) - block $on_get (result (ref 2)) - block $on_set (type 6) (result i32 (ref 3)) + (func $setting (;1;) (type 7) (param $s i32) (param $k (ref $sk)) (result i32) + block $on_get (result (ref $gk)) + block $on_set (type 6) (result i32 (ref $sk)) local.get $k resume $sk (tag $get $on_get)(tag $set $on_set) return diff --git a/tests/snapshots/local/typed-continuations/lwt.wast/0.print b/tests/snapshots/local/typed-continuations/lwt.wast/0.print index 6dec107915..6fd482867c 100644 --- a/tests/snapshots/local/typed-continuations/lwt.wast/0.print +++ b/tests/snapshots/local/typed-continuations/lwt.wast/0.print @@ -1,9 +1,9 @@ (module $lwt (type $func (;0;) (func)) (type $cont (;1;) (cont $func)) - (type (;2;) (func (param (ref 1)))) + (type (;2;) (func (param (ref $cont)))) (tag $yield (;0;) (type $func)) - (tag $fork (;1;) (type 2) (param (ref 1))) + (tag $fork (;1;) (type 2) (param (ref $cont))) (export "yield" (tag 0)) (export "fork" (tag 1)) ) diff --git a/tests/snapshots/local/typed-continuations/lwt.wast/2.print b/tests/snapshots/local/typed-continuations/lwt.wast/2.print index 0065af1e77..346cda1a08 100644 --- a/tests/snapshots/local/typed-continuations/lwt.wast/2.print +++ b/tests/snapshots/local/typed-continuations/lwt.wast/2.print @@ -1,10 +1,10 @@ (module $example (type $func (;0;) (func)) (type $cont (;1;) (cont $func)) - (type (;2;) (func (param (ref 1)))) + (type (;2;) (func (param (ref $cont)))) (type (;3;) (func (param i32))) (import "lwt" "yield" (tag $yield (;0;) (type $func))) - (import "lwt" "fork" (tag $fork (;1;) (type 2) (param (ref 1)))) + (import "lwt" "fork" (tag $fork (;1;) (type 2) (param (ref $cont)))) (import "spectest" "print_i32" (func $log (;0;) (type 3))) (func $main (;1;) (type $func) i32.const 0 diff --git a/tests/snapshots/local/typed-continuations/lwt.wast/4.print b/tests/snapshots/local/typed-continuations/lwt.wast/4.print index 21160b6021..39a709e616 100644 --- a/tests/snapshots/local/typed-continuations/lwt.wast/4.print +++ b/tests/snapshots/local/typed-continuations/lwt.wast/4.print @@ -2,18 +2,18 @@ (type $func (;0;) (func)) (type $cont (;1;) (cont $func)) (type (;2;) (func (result i32))) - (type (;3;) (func (result (ref null 1)))) - (type (;4;) (func (param (ref null 1)))) + (type (;3;) (func (result (ref null $cont)))) + (type (;4;) (func (param (ref null $cont)))) (func $queue-empty (;0;) (type 2) (result i32) global.get $qfront global.get $qback i32.eq ) - (func $dequeue (;1;) (type 3) (result (ref null 1)) + (func $dequeue (;1;) (type 3) (result (ref null $cont)) (local $i i32) call $queue-empty if ;; label = @1 - ref.null 1 + ref.null $cont return end global.get $qfront @@ -25,7 +25,7 @@ local.get $i table.get $queue ) - (func $enqueue (;2;) (type 4) (param $k (ref null 1)) + (func $enqueue (;2;) (type 4) (param $k (ref null $cont)) global.get $qback table.size $queue i32.eq @@ -34,7 +34,7 @@ global.get $qdelta i32.lt_u if ;; label = @2 - ref.null 1 + ref.null $cont global.get $qdelta table.grow $queue drop @@ -48,7 +48,7 @@ global.get $qback table.copy global.get $qback - ref.null 1 + ref.null $cont global.get $qfront table.fill $queue i32.const 0 @@ -63,7 +63,7 @@ i32.add global.set $qback ) - (table $queue (;0;) 0 (ref null 1)) + (table $queue (;0;) 0 (ref null $cont)) (global $qdelta (;0;) i32 i32.const 10) (global $qback (;1;) (mut i32) i32.const 0) (global $qfront (;2;) (mut i32) i32.const 0) diff --git a/tests/snapshots/local/typed-continuations/lwt.wast/6.print b/tests/snapshots/local/typed-continuations/lwt.wast/6.print index 913dc7cdb9..cd2a45652b 100644 --- a/tests/snapshots/local/typed-continuations/lwt.wast/6.print +++ b/tests/snapshots/local/typed-continuations/lwt.wast/6.print @@ -1,25 +1,25 @@ (module $scheduler (type $func (;0;) (func)) (type $cont (;1;) (cont $func)) - (type (;2;) (func (param (ref 1)))) + (type (;2;) (func (param (ref $cont)))) (type (;3;) (func (result i32))) - (type (;4;) (func (result (ref null 1)))) - (type (;5;) (func (param (ref null 1)))) - (type (;6;) (func (result (ref 1) (ref 1)))) + (type (;4;) (func (result (ref null $cont)))) + (type (;5;) (func (param (ref null $cont)))) + (type (;6;) (func (result (ref $cont) (ref $cont)))) (import "lwt" "yield" (tag $yield (;0;) (type $func))) - (import "lwt" "fork" (tag $fork (;1;) (type 2) (param (ref 1)))) + (import "lwt" "fork" (tag $fork (;1;) (type 2) (param (ref $cont)))) (import "queue" "queue-empty" (func $queue-empty (;0;) (type 3))) (import "queue" "dequeue" (func $dequeue (;1;) (type 4))) (import "queue" "enqueue" (func $enqueue (;2;) (type 5))) - (func $sync (;3;) (type 5) (param $nextk (ref null 1)) + (func $sync (;3;) (type 5) (param $nextk (ref null $cont)) loop $l local.get $nextk ref.is_null if ;; label = @2 return end - block $on_yield (result (ref 1)) - block $on_fork (type 6) (result (ref 1) (ref 1)) + block $on_yield (result (ref $cont)) + block $on_fork (type 6) (result (ref $cont) (ref $cont)) local.get $nextk resume $cont (tag $yield $on_yield)(tag $fork $on_fork) call $dequeue @@ -34,15 +34,15 @@ br $l end ) - (func $kt (;4;) (type 5) (param $nextk (ref null 1)) + (func $kt (;4;) (type 5) (param $nextk (ref null $cont)) loop $l local.get $nextk ref.is_null if ;; label = @2 return end - block $on_yield (result (ref 1)) - block $on_fork (type 6) (result (ref 1) (ref 1)) + block $on_yield (result (ref $cont)) + block $on_fork (type 6) (result (ref $cont) (ref $cont)) local.get $nextk resume $cont (tag $yield $on_yield)(tag $fork $on_fork) call $dequeue @@ -59,15 +59,15 @@ br $l end ) - (func $tk (;5;) (type 5) (param $nextk (ref null 1)) + (func $tk (;5;) (type 5) (param $nextk (ref null $cont)) loop $l local.get $nextk ref.is_null if ;; label = @2 return end - block $on_yield (result (ref 1)) - block $on_fork (type 6) (result (ref 1) (ref 1)) + block $on_yield (result (ref $cont)) + block $on_fork (type 6) (result (ref $cont) (ref $cont)) local.get $nextk resume $cont (tag $yield $on_yield)(tag $fork $on_fork) call $dequeue @@ -84,15 +84,15 @@ br $l end ) - (func $ykt (;6;) (type 5) (param $nextk (ref null 1)) + (func $ykt (;6;) (type 5) (param $nextk (ref null $cont)) loop $l local.get $nextk ref.is_null if ;; label = @2 return end - block $on_yield (result (ref 1)) - block $on_fork (type 6) (result (ref 1) (ref 1)) + block $on_yield (result (ref $cont)) + block $on_fork (type 6) (result (ref $cont) (ref $cont)) local.get $nextk resume $cont (tag $yield $on_yield)(tag $fork $on_fork) call $dequeue @@ -111,15 +111,15 @@ br $l end ) - (func $ytk (;7;) (type 5) (param $nextk (ref null 1)) + (func $ytk (;7;) (type 5) (param $nextk (ref null $cont)) loop $l local.get $nextk ref.is_null if ;; label = @2 return end - block $on_yield (result (ref 1)) - block $on_fork (type 6) (result (ref 1) (ref 1)) + block $on_yield (result (ref $cont)) + block $on_fork (type 6) (result (ref $cont) (ref $cont)) local.get $nextk resume $cont (tag $yield $on_yield)(tag $fork $on_fork) call $dequeue diff --git a/tests/snapshots/local/typed-continuations/lwt.wast/8.print b/tests/snapshots/local/typed-continuations/lwt.wast/8.print index 2d2fe2b32a..39639d49fd 100644 --- a/tests/snapshots/local/typed-continuations/lwt.wast/8.print +++ b/tests/snapshots/local/typed-continuations/lwt.wast/8.print @@ -1,7 +1,7 @@ (module (type $func (;0;) (func)) (type $cont (;1;) (cont $func)) - (type (;2;) (func (param (ref null 1)))) + (type (;2;) (func (param (ref null $cont)))) (type (;3;) (func (param i32))) (import "scheduler" "sync" (func $scheduler-sync (;0;) (type 2))) (import "scheduler" "kt" (func $scheduler-kt (;1;) (type 2))) diff --git a/tests/snapshots/local/typed-continuations/pipes.wast/0.print b/tests/snapshots/local/typed-continuations/pipes.wast/0.print index 3763f91e23..0376a28f75 100644 --- a/tests/snapshots/local/typed-continuations/pipes.wast/0.print +++ b/tests/snapshots/local/typed-continuations/pipes.wast/0.print @@ -4,9 +4,9 @@ (type $producer (;2;) (cont $pfun)) (type $consumer (;3;) (cont $cfun)) (type (;4;) (func (param i32))) - (type (;5;) (func (param (ref 2) (ref 3)))) - (type (;6;) (func (result i32 (ref 2)))) - (func $piper (;0;) (type 5) (param $p (ref 2)) (param $c (ref 3)) + (type (;5;) (func (param (ref $producer) (ref $consumer)))) + (type (;6;) (func (result i32 (ref $producer)))) + (func $piper (;0;) (type 5) (param $p (ref $producer)) (param $c (ref $consumer)) (local $n i32) (local $consuming i32) i32.const -1 local.set $n @@ -15,7 +15,7 @@ loop $l local.get $consuming if ;; label = @2 - block $on-receive (result (ref 3)) + block $on-receive (result (ref $consumer)) local.get $n local.get $c resume $consumer (tag $receive $on-receive) @@ -26,7 +26,7 @@ local.set $consuming br $l end - block $on-send (type 6) (result i32 (ref 2)) + block $on-send (type 6) (result i32 (ref $producer)) local.get $p resume $producer (tag $send $on-send) return diff --git a/tests/snapshots/local/typed-continuations/pipes.wast/2.print b/tests/snapshots/local/typed-continuations/pipes.wast/2.print index ceb54a755a..e26ddafa46 100644 --- a/tests/snapshots/local/typed-continuations/pipes.wast/2.print +++ b/tests/snapshots/local/typed-continuations/pipes.wast/2.print @@ -4,7 +4,7 @@ (type $producer (;2;) (cont $pfun)) (type $consumer (;3;) (cont $cfun)) (type (;4;) (func (param i32))) - (type (;5;) (func (param (ref 2) (ref 3)))) + (type (;5;) (func (param (ref $producer) (ref $consumer)))) (import "pipes" "send" (tag $send (;0;) (type 4) (param i32))) (import "pipes" "receive" (tag $receive (;1;) (type $pfun) (result i32))) (import "pipes" "pipe" (func $pipe (;0;) (type 5))) diff --git a/tests/snapshots/local/typed-continuations/static-lwt.wast/4.print b/tests/snapshots/local/typed-continuations/static-lwt.wast/4.print index 3d330c35d6..174db6d7df 100644 --- a/tests/snapshots/local/typed-continuations/static-lwt.wast/4.print +++ b/tests/snapshots/local/typed-continuations/static-lwt.wast/4.print @@ -2,18 +2,18 @@ (type $func (;0;) (func)) (type $cont (;1;) (cont $func)) (type (;2;) (func (result i32))) - (type (;3;) (func (result (ref null 1)))) - (type (;4;) (func (param (ref 1)))) + (type (;3;) (func (result (ref null $cont)))) + (type (;4;) (func (param (ref $cont)))) (func $queue-empty (;0;) (type 2) (result i32) global.get $qfront global.get $qback i32.eq ) - (func $dequeue (;1;) (type 3) (result (ref null 1)) + (func $dequeue (;1;) (type 3) (result (ref null $cont)) (local $i i32) call $queue-empty if ;; label = @1 - ref.null 1 + ref.null $cont return end global.get $qfront @@ -25,7 +25,7 @@ local.get $i table.get $queue ) - (func $enqueue (;2;) (type 4) (param $k (ref 1)) + (func $enqueue (;2;) (type 4) (param $k (ref $cont)) global.get $qback table.size $queue i32.eq @@ -34,7 +34,7 @@ global.get $qdelta i32.lt_u if ;; label = @2 - ref.null 1 + ref.null $cont global.get $qdelta table.grow $queue drop @@ -48,7 +48,7 @@ global.get $qback table.copy global.get $qback - ref.null 1 + ref.null $cont global.get $qfront table.fill $queue i32.const 0 @@ -63,7 +63,7 @@ i32.add global.set $qback ) - (table $queue (;0;) 0 (ref null 1)) + (table $queue (;0;) 0 (ref null $cont)) (global $qdelta (;0;) i32 i32.const 10) (global $qback (;1;) (mut i32) i32.const 0) (global $qfront (;2;) (mut i32) i32.const 0) diff --git a/tests/snapshots/local/typed-continuations/static-lwt.wast/6.print b/tests/snapshots/local/typed-continuations/static-lwt.wast/6.print index 175332e9dc..5ca9f9cf01 100644 --- a/tests/snapshots/local/typed-continuations/static-lwt.wast/6.print +++ b/tests/snapshots/local/typed-continuations/static-lwt.wast/6.print @@ -2,8 +2,8 @@ (type $func (;0;) (func)) (type $cont (;1;) (cont $func)) (type (;2;) (func (result i32))) - (type (;3;) (func (result (ref null 1)))) - (type (;4;) (func (param (ref 1)))) + (type (;3;) (func (result (ref null $cont)))) + (type (;4;) (func (param (ref $cont)))) (import "lwt" "yield" (tag $yield (;0;) (type $func))) (import "queue" "queue-empty" (func $queue-empty (;0;) (type 2))) (import "queue" "dequeue" (func $dequeue (;1;) (type 3))) @@ -14,7 +14,7 @@ if ;; label = @2 return end - block $on_yield (result (ref 1)) + block $on_yield (result (ref $cont)) call $dequeue resume $cont (tag $yield $on_yield) br $l diff --git a/tests/snapshots/local/typed-continuations/static-lwt.wast/8.print b/tests/snapshots/local/typed-continuations/static-lwt.wast/8.print index 4030ddeb80..c6dbc2702f 100644 --- a/tests/snapshots/local/typed-continuations/static-lwt.wast/8.print +++ b/tests/snapshots/local/typed-continuations/static-lwt.wast/8.print @@ -1,7 +1,7 @@ (module (type $func (;0;) (func)) (type $cont (;1;) (cont $func)) - (type (;2;) (func (param (ref 1)))) + (type (;2;) (func (param (ref $cont)))) (type (;3;) (func (param i32))) (import "scheduler" "run" (func $scheduler (;0;) (type $func))) (import "queue" "enqueue" (func $enqueue (;1;) (type 2))) diff --git a/tests/snapshots/testsuite/proposals/function-references/br_on_non_null.wast/0.print b/tests/snapshots/testsuite/proposals/function-references/br_on_non_null.wast/0.print index e0329c705e..c31166a513 100644 --- a/tests/snapshots/testsuite/proposals/function-references/br_on_non_null.wast/0.print +++ b/tests/snapshots/testsuite/proposals/function-references/br_on_non_null.wast/0.print @@ -1,9 +1,9 @@ (module (type $t (;0;) (func (result i32))) - (type (;1;) (func (param (ref 0)) (result i32))) - (type (;2;) (func (param (ref null 0)) (result i32))) - (func $nn (;0;) (type 1) (param $r (ref 0)) (result i32) - block $l (result (ref 0)) + (type (;1;) (func (param (ref $t)) (result i32))) + (type (;2;) (func (param (ref null $t)) (result i32))) + (func $nn (;0;) (type 1) (param $r (ref $t)) (result i32) + block $l (result (ref $t)) local.get $r br_on_non_null $l i32.const -1 @@ -11,8 +11,8 @@ end call_ref $t ) - (func $n (;1;) (type 2) (param $r (ref null 0)) (result i32) - block $l (result (ref 0)) + (func $n (;1;) (type 2) (param $r (ref null $t)) (result i32) + block $l (result (ref $t)) local.get $r br_on_non_null $l i32.const -1 @@ -24,7 +24,7 @@ i32.const 7 ) (func (;3;) (type $t) (result i32) - ref.null 0 + ref.null $t call $n ) (func (;4;) (type $t) (result i32) @@ -36,7 +36,7 @@ call $n ) (func (;6;) (type $t) (result i32) - block $l (result (ref 0)) + block $l (result (ref $t)) unreachable br_on_non_null $l i32.const -1 diff --git a/tests/snapshots/testsuite/proposals/function-references/br_on_non_null.wast/5.print b/tests/snapshots/testsuite/proposals/function-references/br_on_non_null.wast/5.print index 08dc0edf52..bea13444c9 100644 --- a/tests/snapshots/testsuite/proposals/function-references/br_on_non_null.wast/5.print +++ b/tests/snapshots/testsuite/proposals/function-references/br_on_non_null.wast/5.print @@ -1,10 +1,10 @@ (module (type $t (;0;) (func)) - (type (;1;) (func (param (ref null 0)))) + (type (;1;) (func (param (ref null $t)))) (type (;2;) (func (param funcref))) (type (;3;) (func (param externref))) - (func (;0;) (type 1) (param $r (ref null 0)) - block (result (ref 0)) ;; label = @1 + (func (;0;) (type 1) (param $r (ref null $t)) + block (result (ref $t)) ;; label = @1 local.get $r br_on_non_null 0 (;@1;) unreachable diff --git a/tests/snapshots/testsuite/proposals/function-references/br_on_non_null.wast/6.print b/tests/snapshots/testsuite/proposals/function-references/br_on_non_null.wast/6.print index a0185721b8..fd25db678c 100644 --- a/tests/snapshots/testsuite/proposals/function-references/br_on_non_null.wast/6.print +++ b/tests/snapshots/testsuite/proposals/function-references/br_on_non_null.wast/6.print @@ -1,14 +1,14 @@ (module (type $t (;0;) (func (param i32) (result i32))) - (type (;1;) (func (param i32 (ref null 0)) (result i32))) - (type (;2;) (func (result i32 (ref 0)))) + (type (;1;) (func (param i32 (ref null $t)) (result i32))) + (type (;2;) (func (result i32 (ref $t)))) (func $f (;0;) (type $t) (param i32) (result i32) local.get 0 local.get 0 i32.mul ) - (func $a (;1;) (type 1) (param $n i32) (param $r (ref null 0)) (result i32) - block $l (type 2) (result i32 (ref 0)) + (func $a (;1;) (type 1) (param $n i32) (param $r (ref null $t)) (result i32) + block $l (type 2) (result i32 (ref $t)) local.get $n local.get $r br_on_non_null $l @@ -18,7 +18,7 @@ ) (func (;2;) (type $t) (param $n i32) (result i32) local.get $n - ref.null 0 + ref.null $t call $a ) (func (;3;) (type $t) (param $n i32) (result i32) diff --git a/tests/snapshots/testsuite/proposals/function-references/br_on_null.wast/0.print b/tests/snapshots/testsuite/proposals/function-references/br_on_null.wast/0.print index 0aa70467fb..be60e9af88 100644 --- a/tests/snapshots/testsuite/proposals/function-references/br_on_null.wast/0.print +++ b/tests/snapshots/testsuite/proposals/function-references/br_on_null.wast/0.print @@ -1,8 +1,8 @@ (module (type $t (;0;) (func (result i32))) - (type (;1;) (func (param (ref 0)) (result i32))) - (type (;2;) (func (param (ref null 0)) (result i32))) - (func $nn (;0;) (type 1) (param $r (ref 0)) (result i32) + (type (;1;) (func (param (ref $t)) (result i32))) + (type (;2;) (func (param (ref null $t)) (result i32))) + (func $nn (;0;) (type 1) (param $r (ref $t)) (result i32) block $l local.get $r br_on_null $l @@ -11,7 +11,7 @@ end i32.const -1 ) - (func $n (;1;) (type 2) (param $r (ref null 0)) (result i32) + (func $n (;1;) (type 2) (param $r (ref null $t)) (result i32) block $l local.get $r br_on_null $l @@ -24,7 +24,7 @@ i32.const 7 ) (func (;3;) (type $t) (result i32) - ref.null 0 + ref.null $t call $n ) (func (;4;) (type $t) (result i32) diff --git a/tests/snapshots/testsuite/proposals/function-references/br_on_null.wast/5.print b/tests/snapshots/testsuite/proposals/function-references/br_on_null.wast/5.print index f7ecabad1a..1946ceaca1 100644 --- a/tests/snapshots/testsuite/proposals/function-references/br_on_null.wast/5.print +++ b/tests/snapshots/testsuite/proposals/function-references/br_on_null.wast/5.print @@ -1,9 +1,9 @@ (module (type $t (;0;) (func)) - (type (;1;) (func (param (ref null 0)))) + (type (;1;) (func (param (ref null $t)))) (type (;2;) (func (param funcref))) (type (;3;) (func (param externref))) - (func (;0;) (type 1) (param $r (ref null 0)) + (func (;0;) (type 1) (param $r (ref null $t)) local.get $r br_on_null 0 (;@0;) drop diff --git a/tests/snapshots/testsuite/proposals/function-references/br_on_null.wast/6.print b/tests/snapshots/testsuite/proposals/function-references/br_on_null.wast/6.print index 4059e9ee4d..ffab737fcf 100644 --- a/tests/snapshots/testsuite/proposals/function-references/br_on_null.wast/6.print +++ b/tests/snapshots/testsuite/proposals/function-references/br_on_null.wast/6.print @@ -1,12 +1,12 @@ (module (type $t (;0;) (func (param i32) (result i32))) - (type (;1;) (func (param i32 (ref null 0)) (result i32))) + (type (;1;) (func (param i32 (ref null $t)) (result i32))) (func $f (;0;) (type $t) (param i32) (result i32) local.get 0 local.get 0 i32.mul ) - (func $a (;1;) (type 1) (param $n i32) (param $r (ref null 0)) (result i32) + (func $a (;1;) (type 1) (param $n i32) (param $r (ref null $t)) (result i32) block $l (result i32) local.get $n local.get $r @@ -17,7 +17,7 @@ ) (func (;2;) (type $t) (param $n i32) (result i32) local.get $n - ref.null 0 + ref.null $t call $a ) (func (;3;) (type $t) (param $n i32) (result i32) diff --git a/tests/snapshots/testsuite/proposals/function-references/br_table.wast/0.print b/tests/snapshots/testsuite/proposals/function-references/br_table.wast/0.print index 2a13061a45..c3603f18ba 100644 --- a/tests/snapshots/testsuite/proposals/function-references/br_table.wast/0.print +++ b/tests/snapshots/testsuite/proposals/function-references/br_table.wast/0.print @@ -786,7 +786,7 @@ (func $tf (;71;) (type $t)) (func (;72;) (type 9) (param i32) (result funcref) block $l1 (result funcref) - block $l2 (result (ref null 1)) + block $l2 (result (ref null $t)) i32.const 0 table.get $t local.get 0 @@ -796,7 +796,7 @@ ) (func (;73;) (type 9) (param i32) (result funcref) block $l1 (result funcref) - block $l2 (result (ref null 1)) + block $l2 (result (ref null $t)) i32.const 0 table.get $t local.get 0 @@ -806,7 +806,7 @@ ) (func (;74;) (type 9) (param i32) (result funcref) block $l1 (result funcref) - block $l2 (result (ref null 1)) + block $l2 (result (ref null $t)) i32.const 0 table.get $t local.get 0 @@ -816,7 +816,7 @@ ) (func (;75;) (type 9) (param i32) (result funcref) block $l1 (result funcref) - block $l2 (result (ref null 1)) + block $l2 (result (ref null $t)) i32.const 0 table.get $t local.get 0 @@ -826,8 +826,8 @@ ) (func (;76;) (type 9) (param i32) (result funcref) block $l1 (result funcref) - block $l2 (result (ref null 1)) - ref.null 1 + block $l2 (result (ref null $t)) + ref.null $t local.get 0 br_table $l1 $l2 $l1 end @@ -835,8 +835,8 @@ ) (func (;77;) (type 9) (param i32) (result funcref) block $l1 (result funcref) - block $l2 (result (ref null 1)) - block $l3 (result (ref 1)) + block $l2 (result (ref null $t)) + block $l3 (result (ref $t)) ref.func $tf local.get 0 br_table $l3 $l2 $l1 @@ -845,7 +845,7 @@ end ) (table (;0;) 1 1 funcref) - (table $t (;1;) 1 1 (ref null 1)) + (table $t (;1;) 1 1 (ref null $t)) (memory (;0;) 1) (global $a (;0;) (mut i32) i32.const 10) (export "type-i32" (func 1)) @@ -924,5 +924,5 @@ (export "meet-nullref" (func 76)) (export "meet-multi-ref" (func 77)) (elem (;0;) (i32.const 0) func $f) - (elem (;1;) (table $t) (i32.const 0) (ref null 1) (ref.func $tf)) + (elem (;1;) (table $t) (i32.const 0) (ref null $t) (ref.func $tf)) ) diff --git a/tests/snapshots/testsuite/proposals/function-references/call_ref.wast/0.print b/tests/snapshots/testsuite/proposals/function-references/call_ref.wast/0.print index 620d08529b..b983464ae1 100644 --- a/tests/snapshots/testsuite/proposals/function-references/call_ref.wast/0.print +++ b/tests/snapshots/testsuite/proposals/function-references/call_ref.wast/0.print @@ -2,9 +2,9 @@ (type $ii (;0;) (func (param i32) (result i32))) (type $ll (;1;) (func (param i64) (result i64))) (type $lll (;2;) (func (param i64 i64) (result i64))) - (type (;3;) (func (param (ref 0) i32) (result i32))) + (type (;3;) (func (param (ref $ii) i32) (result i32))) (type (;4;) (func (result i32))) - (func $apply (;0;) (type 3) (param $f (ref 0)) (param $x i32) (result i32) + (func $apply (;0;) (type 3) (param $f (ref $ii)) (param $x i32) (result i32) local.get $x local.get $f call_ref $ii @@ -20,7 +20,7 @@ i32.sub ) (func (;3;) (type $ii) (param $x i32) (result i32) - (local $rf (ref null 0)) (local $rg (ref null 0)) + (local $rf (ref null $ii)) (local $rg (ref null $ii)) ref.func $f local.set $rf ref.func $g @@ -33,7 +33,7 @@ ) (func (;4;) (type 4) (result i32) i32.const 1 - ref.null 0 + ref.null $ii call_ref $ii ) (func $fac (;5;) (type $ll) (param i64) (result i64) @@ -113,11 +113,11 @@ call_ref $ll end ) - (global $fac (;0;) (ref 1) ref.func $fac) - (global $fac-acc (;1;) (ref 2) ref.func $fac-acc) - (global $fib (;2;) (ref 1) ref.func $fib) - (global $even (;3;) (ref 1) ref.func $even) - (global $odd (;4;) (ref 1) ref.func $odd) + (global $fac (;0;) (ref $ll) ref.func $fac) + (global $fac-acc (;1;) (ref $lll) ref.func $fac-acc) + (global $fib (;2;) (ref $ll) ref.func $fib) + (global $even (;3;) (ref $ll) ref.func $even) + (global $odd (;4;) (ref $ll) ref.func $odd) (export "run" (func 3)) (export "null" (func 4)) (export "fac" (func $fac)) diff --git a/tests/snapshots/testsuite/proposals/function-references/linking.wast/124.print b/tests/snapshots/testsuite/proposals/function-references/linking.wast/124.print index bd544361ba..23f45e5f9b 100644 --- a/tests/snapshots/testsuite/proposals/function-references/linking.wast/124.print +++ b/tests/snapshots/testsuite/proposals/function-references/linking.wast/124.print @@ -1,7 +1,7 @@ (module $Mtable_ex (type $t (;0;) (func)) (table (;0;) 1 funcref) - (table (;1;) 1 (ref null 0)) + (table (;1;) 1 (ref null $t)) (table (;2;) 1 externref) (export "t-funcnull" (table 0)) (export "t-refnull" (table 1)) diff --git a/tests/snapshots/testsuite/proposals/function-references/linking.wast/126.print b/tests/snapshots/testsuite/proposals/function-references/linking.wast/126.print index 224e9aa3d3..45cb1a5857 100644 --- a/tests/snapshots/testsuite/proposals/function-references/linking.wast/126.print +++ b/tests/snapshots/testsuite/proposals/function-references/linking.wast/126.print @@ -1,6 +1,6 @@ (module (type $t (;0;) (func)) (import "Mtable_ex" "t-funcnull" (table (;0;) 1 funcref)) - (import "Mtable_ex" "t-refnull" (table (;1;) 1 (ref null 0))) + (import "Mtable_ex" "t-refnull" (table (;1;) 1 (ref null $t))) (import "Mtable_ex" "t-extern" (table (;2;) 1 externref)) ) diff --git a/tests/snapshots/testsuite/proposals/function-references/linking.wast/31.print b/tests/snapshots/testsuite/proposals/function-references/linking.wast/31.print index 60068ec2f1..7c9865ad76 100644 --- a/tests/snapshots/testsuite/proposals/function-references/linking.wast/31.print +++ b/tests/snapshots/testsuite/proposals/function-references/linking.wast/31.print @@ -3,13 +3,13 @@ (func $f (;0;) (type $t)) (global (;0;) funcref ref.null func) (global (;1;) (ref func) ref.func $f) - (global (;2;) (ref null 0) ref.null 0) - (global (;3;) (ref 0) ref.func $f) + (global (;2;) (ref null $t) ref.null $t) + (global (;3;) (ref $t) ref.func $f) (global (;4;) externref ref.null extern) (global (;5;) (mut funcref) ref.null func) (global (;6;) (mut (ref func)) ref.func $f) - (global (;7;) (mut (ref null 0)) ref.null 0) - (global (;8;) (mut (ref 0)) ref.func $f) + (global (;7;) (mut (ref null $t)) ref.null $t) + (global (;8;) (mut (ref $t)) ref.func $f) (global (;9;) (mut externref) ref.null extern) (export "g-const-funcnull" (global 0)) (export "g-const-func" (global 1)) diff --git a/tests/snapshots/testsuite/proposals/function-references/linking.wast/33.print b/tests/snapshots/testsuite/proposals/function-references/linking.wast/33.print index 710e143cac..00ed92260c 100644 --- a/tests/snapshots/testsuite/proposals/function-references/linking.wast/33.print +++ b/tests/snapshots/testsuite/proposals/function-references/linking.wast/33.print @@ -6,13 +6,13 @@ (import "Mref_ex" "g-const-ref" (global (;3;) funcref)) (import "Mref_ex" "g-const-func" (global (;4;) (ref func))) (import "Mref_ex" "g-const-ref" (global (;5;) (ref func))) - (import "Mref_ex" "g-const-refnull" (global (;6;) (ref null 0))) - (import "Mref_ex" "g-const-ref" (global (;7;) (ref null 0))) - (import "Mref_ex" "g-const-ref" (global (;8;) (ref 0))) + (import "Mref_ex" "g-const-refnull" (global (;6;) (ref null $t))) + (import "Mref_ex" "g-const-ref" (global (;7;) (ref null $t))) + (import "Mref_ex" "g-const-ref" (global (;8;) (ref $t))) (import "Mref_ex" "g-const-extern" (global (;9;) externref)) (import "Mref_ex" "g-var-funcnull" (global (;10;) (mut funcref))) (import "Mref_ex" "g-var-func" (global (;11;) (mut (ref func)))) - (import "Mref_ex" "g-var-refnull" (global (;12;) (mut (ref null 0)))) - (import "Mref_ex" "g-var-ref" (global (;13;) (mut (ref 0)))) + (import "Mref_ex" "g-var-refnull" (global (;12;) (mut (ref null $t)))) + (import "Mref_ex" "g-var-ref" (global (;13;) (mut (ref $t)))) (import "Mref_ex" "g-var-extern" (global (;14;) (mut externref))) ) diff --git a/tests/snapshots/testsuite/proposals/function-references/ref.wast/0.print b/tests/snapshots/testsuite/proposals/function-references/ref.wast/0.print index 826cb09e3e..08f98a4551 100644 --- a/tests/snapshots/testsuite/proposals/function-references/ref.wast/0.print +++ b/tests/snapshots/testsuite/proposals/function-references/ref.wast/0.print @@ -1,5 +1,5 @@ (module (type $t (;0;) (func)) - (type (;1;) (func (param funcref externref (ref func) (ref extern) (ref 0) (ref 0) (ref 0) (ref 0) funcref externref (ref null 0) (ref null 0)))) - (func (;0;) (type 1) (param funcref externref (ref func) (ref extern) (ref 0) (ref 0) (ref 0) (ref 0) funcref externref (ref null 0) (ref null 0))) + (type (;1;) (func (param funcref externref (ref func) (ref extern) (ref $t) (ref $t) (ref $t) (ref $t) funcref externref (ref null $t) (ref null $t)))) + (func (;0;) (type 1) (param funcref externref (ref func) (ref extern) (ref $t) (ref $t) (ref $t) (ref $t) funcref externref (ref null $t) (ref null $t))) ) diff --git a/tests/snapshots/testsuite/proposals/function-references/ref_as_non_null.wast/0.print b/tests/snapshots/testsuite/proposals/function-references/ref_as_non_null.wast/0.print index e874215a89..d4861f7951 100644 --- a/tests/snapshots/testsuite/proposals/function-references/ref_as_non_null.wast/0.print +++ b/tests/snapshots/testsuite/proposals/function-references/ref_as_non_null.wast/0.print @@ -1,13 +1,13 @@ (module (type $t (;0;) (func (result i32))) - (type (;1;) (func (param (ref 0)) (result i32))) - (type (;2;) (func (param (ref null 0)) (result i32))) - (func $nn (;0;) (type 1) (param $r (ref 0)) (result i32) + (type (;1;) (func (param (ref $t)) (result i32))) + (type (;2;) (func (param (ref null $t)) (result i32))) + (func $nn (;0;) (type 1) (param $r (ref $t)) (result i32) local.get $r ref.as_non_null call_ref $t ) - (func $n (;1;) (type 2) (param $r (ref null 0)) (result i32) + (func $n (;1;) (type 2) (param $r (ref null $t)) (result i32) local.get $r ref.as_non_null call_ref $t @@ -16,7 +16,7 @@ i32.const 7 ) (func (;3;) (type $t) (result i32) - ref.null 0 + ref.null $t call $n ) (func (;4;) (type $t) (result i32) diff --git a/tests/snapshots/testsuite/proposals/function-references/ref_as_non_null.wast/6.print b/tests/snapshots/testsuite/proposals/function-references/ref_as_non_null.wast/6.print index c2f8267b27..43c84a2099 100644 --- a/tests/snapshots/testsuite/proposals/function-references/ref_as_non_null.wast/6.print +++ b/tests/snapshots/testsuite/proposals/function-references/ref_as_non_null.wast/6.print @@ -1,9 +1,9 @@ (module (type $t (;0;) (func)) - (type (;1;) (func (param (ref 0)))) + (type (;1;) (func (param (ref $t)))) (type (;2;) (func (param (ref func)))) (type (;3;) (func (param (ref extern)))) - (func (;0;) (type 1) (param $r (ref 0)) + (func (;0;) (type 1) (param $r (ref $t)) local.get $r ref.as_non_null drop diff --git a/tests/snapshots/testsuite/proposals/function-references/ref_is_null.wast/0.print b/tests/snapshots/testsuite/proposals/function-references/ref_is_null.wast/0.print index f1d39bf1be..f354ae718f 100644 --- a/tests/snapshots/testsuite/proposals/function-references/ref_is_null.wast/0.print +++ b/tests/snapshots/testsuite/proposals/function-references/ref_is_null.wast/0.print @@ -2,7 +2,7 @@ (type $t (;0;) (func)) (type (;1;) (func (param funcref) (result i32))) (type (;2;) (func (param externref) (result i32))) - (type (;3;) (func (param (ref null 0)) (result i32))) + (type (;3;) (func (param (ref null $t)) (result i32))) (type (;4;) (func (result i32))) (type (;5;) (func (param externref))) (type (;6;) (func (param i32) (result i32))) @@ -15,12 +15,12 @@ local.get $x ref.is_null ) - (func $f3 (;3;) (type 3) (param $x (ref null 0)) (result i32) + (func $f3 (;3;) (type 3) (param $x (ref null $t)) (result i32) local.get $x ref.is_null ) (func $f3' (;4;) (type 4) (result i32) - ref.null 0 + ref.null $t call $f3 ) (func (;5;) (type 5) (param $r externref) @@ -36,7 +36,7 @@ ref.null extern table.set $t2 i32.const 1 - ref.null 0 + ref.null $t table.set $t3 ) (func (;7;) (type 6) (param $x i32) (result i32) @@ -56,7 +56,7 @@ ) (table $t1 (;0;) 2 funcref) (table $t2 (;1;) 2 externref) - (table $t3 (;2;) 2 (ref null 0)) + (table $t3 (;2;) 2 (ref null $t)) (export "funcref" (func $f1)) (export "externref" (func $f2)) (export "ref-null" (func $f3')) @@ -66,5 +66,5 @@ (export "externref-elem" (func 8)) (export "ref-elem" (func 9)) (elem (;0;) (i32.const 1) func $dummy) - (elem (;1;) (table $t3) (i32.const 1) (ref 0) (ref.func $dummy)) + (elem (;1;) (table $t3) (i32.const 1) (ref $t) (ref.func $dummy)) ) diff --git a/tests/snapshots/testsuite/proposals/function-references/ref_is_null.wast/19.print b/tests/snapshots/testsuite/proposals/function-references/ref_is_null.wast/19.print index b52ec60922..130a8a6860 100644 --- a/tests/snapshots/testsuite/proposals/function-references/ref_is_null.wast/19.print +++ b/tests/snapshots/testsuite/proposals/function-references/ref_is_null.wast/19.print @@ -1,9 +1,9 @@ (module (type $t (;0;) (func)) - (type (;1;) (func (param (ref 0)))) + (type (;1;) (func (param (ref $t)))) (type (;2;) (func (param (ref func)))) (type (;3;) (func (param (ref extern)))) - (func (;0;) (type 1) (param $r (ref 0)) + (func (;0;) (type 1) (param $r (ref $t)) local.get $r ref.is_null drop diff --git a/tests/snapshots/testsuite/proposals/function-references/ref_null.wast/0.print b/tests/snapshots/testsuite/proposals/function-references/ref_null.wast/0.print index 16724bce85..ac72881414 100644 --- a/tests/snapshots/testsuite/proposals/function-references/ref_null.wast/0.print +++ b/tests/snapshots/testsuite/proposals/function-references/ref_null.wast/0.print @@ -2,19 +2,19 @@ (type $t (;0;) (func)) (type (;1;) (func (result externref))) (type (;2;) (func (result funcref))) - (type (;3;) (func (result (ref null 0)))) + (type (;3;) (func (result (ref null $t)))) (func (;0;) (type 1) (result externref) ref.null extern ) (func (;1;) (type 2) (result funcref) ref.null func ) - (func (;2;) (type 3) (result (ref null 0)) - ref.null 0 + (func (;2;) (type 3) (result (ref null $t)) + ref.null $t ) (global (;0;) externref ref.null extern) (global (;1;) funcref ref.null func) - (global (;2;) (ref null 0) ref.null 0) + (global (;2;) (ref null $t) ref.null $t) (export "externref" (func 0)) (export "funcref" (func 1)) (export "ref" (func 2)) diff --git a/tests/snapshots/testsuite/proposals/function-references/return_call_ref.wast/0.print b/tests/snapshots/testsuite/proposals/function-references/return_call_ref.wast/0.print index 2e35173950..451693d9de 100644 --- a/tests/snapshots/testsuite/proposals/function-references/return_call_ref.wast/0.print +++ b/tests/snapshots/testsuite/proposals/function-references/return_call_ref.wast/0.print @@ -110,7 +110,7 @@ return_call_ref $i64-f64 ) (func (;24;) (type $proc) - ref.null 0 + ref.null $proc return_call_ref $proc ) (func $fac-acc (;25;) (type $i64i64-i64) (param i64 i64) (result i64) @@ -168,22 +168,22 @@ return_call_ref $i64-i64 end ) - (global $const-i32 (;0;) (ref 1) ref.func $const-i32) - (global $const-i64 (;1;) (ref 2) ref.func $const-i64) - (global $const-f32 (;2;) (ref 3) ref.func $const-f32) - (global $const-f64 (;3;) (ref 4) ref.func $const-f64) - (global $id-i32 (;4;) (ref 5) ref.func $id-i32) - (global $id-i64 (;5;) (ref 6) ref.func $id-i64) - (global $id-f32 (;6;) (ref 7) ref.func $id-f32) - (global $id-f64 (;7;) (ref 8) ref.func $id-f64) - (global $f32-i32 (;8;) (ref 9) ref.func $f32-i32) - (global $i32-i64 (;9;) (ref 10) ref.func $i32-i64) - (global $f64-f32 (;10;) (ref 11) ref.func $f64-f32) - (global $i64-f64 (;11;) (ref 12) ref.func $i64-f64) - (global $fac-acc (;12;) (ref 13) ref.func $fac-acc) - (global $count (;13;) (ref 6) ref.func $count) - (global $even (;14;) (ref 6) ref.func $even) - (global $odd (;15;) (ref 6) ref.func $odd) + (global $const-i32 (;0;) (ref $-i32) ref.func $const-i32) + (global $const-i64 (;1;) (ref $-i64) ref.func $const-i64) + (global $const-f32 (;2;) (ref $-f32) ref.func $const-f32) + (global $const-f64 (;3;) (ref $-f64) ref.func $const-f64) + (global $id-i32 (;4;) (ref $i32-i32) ref.func $id-i32) + (global $id-i64 (;5;) (ref $i64-i64) ref.func $id-i64) + (global $id-f32 (;6;) (ref $f32-f32) ref.func $id-f32) + (global $id-f64 (;7;) (ref $f64-f64) ref.func $id-f64) + (global $f32-i32 (;8;) (ref $f32-i32) ref.func $f32-i32) + (global $i32-i64 (;9;) (ref $i32-i64) ref.func $i32-i64) + (global $f64-f32 (;10;) (ref $f64-f32) ref.func $f64-f32) + (global $i64-f64 (;11;) (ref $i64-f64) ref.func $i64-f64) + (global $fac-acc (;12;) (ref $i64i64-i64) ref.func $fac-acc) + (global $count (;13;) (ref $i64-i64) ref.func $count) + (global $even (;14;) (ref $i64-i64) ref.func $even) + (global $odd (;15;) (ref $i64-i64) ref.func $odd) (export "type-i32" (func 12)) (export "type-i64" (func 13)) (export "type-f32" (func 14)) diff --git a/tests/snapshots/testsuite/proposals/function-references/return_call_ref.wast/33.print b/tests/snapshots/testsuite/proposals/function-references/return_call_ref.wast/33.print index 086c98c8b5..11dc25a989 100644 --- a/tests/snapshots/testsuite/proposals/function-references/return_call_ref.wast/33.print +++ b/tests/snapshots/testsuite/proposals/function-references/return_call_ref.wast/33.print @@ -1,18 +1,18 @@ (module (type $t (;0;) (func)) - (type $t1 (;1;) (func (result (ref 0)))) - (type $t2 (;2;) (func (result (ref null 0)))) + (type $t1 (;1;) (func (result (ref $t)))) + (type $t2 (;2;) (func (result (ref null $t)))) (type $t3 (;3;) (func (result (ref func)))) (type $t4 (;4;) (func (result funcref))) - (func $f11 (;0;) (type $t1) (result (ref 0)) + (func $f11 (;0;) (type $t1) (result (ref $t)) ref.func $f11 return_call_ref $t1 ) - (func $f21 (;1;) (type $t2) (result (ref null 0)) + (func $f21 (;1;) (type $t2) (result (ref null $t)) ref.func $f11 return_call_ref $t1 ) - (func $f22 (;2;) (type $t2) (result (ref null 0)) + (func $f22 (;2;) (type $t2) (result (ref null $t)) ref.func $f22 return_call_ref $t2 ) diff --git a/tests/snapshots/testsuite/proposals/function-references/table-sub.wast/0.print b/tests/snapshots/testsuite/proposals/function-references/table-sub.wast/0.print index e5ffc41794..cc4f3a21c3 100644 --- a/tests/snapshots/testsuite/proposals/function-references/table-sub.wast/0.print +++ b/tests/snapshots/testsuite/proposals/function-references/table-sub.wast/0.print @@ -11,6 +11,6 @@ table.copy $t1 $t2 ) (table $t1 (;0;) 10 funcref) - (table $t2 (;1;) 10 (ref null 0)) + (table $t2 (;1;) 10 (ref null $t)) (elem $el (;0;) funcref) ) diff --git a/tests/snapshots/testsuite/proposals/function-references/table.wast/29.print b/tests/snapshots/testsuite/proposals/function-references/table.wast/29.print index cf9883fea8..3122c840d6 100644 --- a/tests/snapshots/testsuite/proposals/function-references/table.wast/29.print +++ b/tests/snapshots/testsuite/proposals/function-references/table.wast/29.print @@ -1,6 +1,6 @@ (module (type $f (;0;) (func)) (func $f (;0;) (type $f)) - (global (;0;) (ref 0) ref.func $f) + (global (;0;) (ref $f) ref.func $f) (export "g" (global 0)) ) diff --git a/tests/snapshots/testsuite/proposals/function-references/table.wast/31.print b/tests/snapshots/testsuite/proposals/function-references/table.wast/31.print index 03b073eb84..1639a3daa1 100644 --- a/tests/snapshots/testsuite/proposals/function-references/table.wast/31.print +++ b/tests/snapshots/testsuite/proposals/function-references/table.wast/31.print @@ -1,7 +1,7 @@ (module (type $dummy (;0;) (func)) (type (;1;) (func (result funcref))) - (import "M" "g" (global $g (;0;) (ref 0))) + (import "M" "g" (global $g (;0;) (ref $dummy))) (func $dummy (;0;) (type $dummy)) (func (;1;) (type 1) (result funcref) i32.const 1 @@ -25,9 +25,9 @@ ) (table $t1 (;0;) 10 funcref) (table $t2 (;1;) 10 funcref ref.func $dummy) - (table $t3 (;2;) 10 (ref 0) ref.func $dummy) + (table $t3 (;2;) 10 (ref $dummy) ref.func $dummy) (table $t4 (;3;) 10 funcref global.get $g) - (table $t5 (;4;) 10 (ref 0) global.get $g) + (table $t5 (;4;) 10 (ref $dummy) global.get $g) (export "get1" (func 1)) (export "get2" (func 2)) (export "get3" (func 3)) diff --git a/tests/snapshots/testsuite/proposals/function-references/table.wast/9.print b/tests/snapshots/testsuite/proposals/function-references/table.wast/9.print index 14198fb29f..7e017d6dd5 100644 --- a/tests/snapshots/testsuite/proposals/function-references/table.wast/9.print +++ b/tests/snapshots/testsuite/proposals/function-references/table.wast/9.print @@ -1,4 +1,4 @@ (module (type $t (;0;) (func)) - (table (;0;) 1 (ref null 0)) + (table (;0;) 1 (ref null $t)) ) diff --git a/tests/snapshots/testsuite/proposals/function-references/type-equivalence.wast/0.print b/tests/snapshots/testsuite/proposals/function-references/type-equivalence.wast/0.print index 363cd4f26c..d5c0f44628 100644 --- a/tests/snapshots/testsuite/proposals/function-references/type-equivalence.wast/0.print +++ b/tests/snapshots/testsuite/proposals/function-references/type-equivalence.wast/0.print @@ -1,13 +1,13 @@ (module (type $t1 (;0;) (func (param f32 f32) (result f32))) (type $t2 (;1;) (func (param f32 f32) (result f32))) - (type (;2;) (func (param (ref 0)))) - (type (;3;) (func (param (ref 1)))) - (func $f1 (;0;) (type 2) (param $r (ref 0)) + (type (;2;) (func (param (ref $t1)))) + (type (;3;) (func (param (ref $t2)))) + (func $f1 (;0;) (type 2) (param $r (ref $t1)) local.get $r call $f2 ) - (func $f2 (;1;) (type 3) (param $r (ref 1)) + (func $f2 (;1;) (type 3) (param $r (ref $t2)) local.get $r call $f1 ) diff --git a/tests/snapshots/testsuite/proposals/function-references/type-equivalence.wast/1.print b/tests/snapshots/testsuite/proposals/function-references/type-equivalence.wast/1.print index c76660d600..1167493998 100644 --- a/tests/snapshots/testsuite/proposals/function-references/type-equivalence.wast/1.print +++ b/tests/snapshots/testsuite/proposals/function-references/type-equivalence.wast/1.print @@ -1,16 +1,16 @@ (module (type $s0 (;0;) (func (param i32) (result f32))) - (type $s1 (;1;) (func (param i32 (ref 0)) (result (ref 0)))) - (type $s2 (;2;) (func (param i32 (ref 0)) (result (ref 0)))) - (type $t1 (;3;) (func (param (ref 1)) (result (ref 2)))) - (type $t2 (;4;) (func (param (ref 2)) (result (ref 1)))) - (type (;5;) (func (param (ref 3)))) - (type (;6;) (func (param (ref 4)))) - (func $f1 (;0;) (type 5) (param $r (ref 3)) + (type $s1 (;1;) (func (param i32 (ref $s0)) (result (ref $s0)))) + (type $s2 (;2;) (func (param i32 (ref $s0)) (result (ref $s0)))) + (type $t1 (;3;) (func (param (ref $s1)) (result (ref $s2)))) + (type $t2 (;4;) (func (param (ref $s2)) (result (ref $s1)))) + (type (;5;) (func (param (ref $t1)))) + (type (;6;) (func (param (ref $t2)))) + (func $f1 (;0;) (type 5) (param $r (ref $t1)) local.get $r call $f2 ) - (func $f2 (;1;) (type 6) (param $r (ref 4)) + (func $f2 (;1;) (type 6) (param $r (ref $t2)) local.get $r call $f1 ) diff --git a/tests/snapshots/testsuite/proposals/function-references/type-equivalence.wast/10.print b/tests/snapshots/testsuite/proposals/function-references/type-equivalence.wast/10.print index d566b45e6d..063cc5834b 100644 --- a/tests/snapshots/testsuite/proposals/function-references/type-equivalence.wast/10.print +++ b/tests/snapshots/testsuite/proposals/function-references/type-equivalence.wast/10.print @@ -1,5 +1,5 @@ (module (type $t2 (;0;) (func (param f32 f32) (result f32))) - (type (;1;) (func (param (ref 0)))) + (type (;1;) (func (param (ref $t2)))) (import "M" "f" (func (;0;) (type 1))) ) diff --git a/tests/snapshots/testsuite/proposals/function-references/type-equivalence.wast/11.print b/tests/snapshots/testsuite/proposals/function-references/type-equivalence.wast/11.print index aeef19eac6..66a9157ef6 100644 --- a/tests/snapshots/testsuite/proposals/function-references/type-equivalence.wast/11.print +++ b/tests/snapshots/testsuite/proposals/function-references/type-equivalence.wast/11.print @@ -1,12 +1,12 @@ (module (type $s0 (;0;) (func (param i32) (result f32))) - (type $s1 (;1;) (func (param i32 (ref 0)) (result (ref 0)))) - (type $s2 (;2;) (func (param i32 (ref 0)) (result (ref 0)))) - (type $t1 (;3;) (func (param (ref 1)) (result (ref 2)))) - (type $t2 (;4;) (func (param (ref 2)) (result (ref 1)))) - (type (;5;) (func (param (ref 3)))) - (func (;0;) (type 5) (param (ref 3))) - (func (;1;) (type 5) (param (ref 3))) + (type $s1 (;1;) (func (param i32 (ref $s0)) (result (ref $s0)))) + (type $s2 (;2;) (func (param i32 (ref $s0)) (result (ref $s0)))) + (type $t1 (;3;) (func (param (ref $s1)) (result (ref $s2)))) + (type $t2 (;4;) (func (param (ref $s2)) (result (ref $s1)))) + (type (;5;) (func (param (ref $t1)))) + (func (;0;) (type 5) (param (ref $t1))) + (func (;1;) (type 5) (param (ref $t1))) (export "f1" (func 0)) (export "f2" (func 1)) ) diff --git a/tests/snapshots/testsuite/proposals/function-references/type-equivalence.wast/13.print b/tests/snapshots/testsuite/proposals/function-references/type-equivalence.wast/13.print index 49438f1fc3..28eac56387 100644 --- a/tests/snapshots/testsuite/proposals/function-references/type-equivalence.wast/13.print +++ b/tests/snapshots/testsuite/proposals/function-references/type-equivalence.wast/13.print @@ -1,11 +1,11 @@ (module (type $s0 (;0;) (func (param i32) (result f32))) - (type $s1 (;1;) (func (param i32 (ref 0)) (result (ref 0)))) - (type $s2 (;2;) (func (param i32 (ref 0)) (result (ref 0)))) - (type $t1 (;3;) (func (param (ref 1)) (result (ref 2)))) - (type $t2 (;4;) (func (param (ref 2)) (result (ref 1)))) - (type (;5;) (func (param (ref 3)))) - (type (;6;) (func (param (ref 4)))) + (type $s1 (;1;) (func (param i32 (ref $s0)) (result (ref $s0)))) + (type $s2 (;2;) (func (param i32 (ref $s0)) (result (ref $s0)))) + (type $t1 (;3;) (func (param (ref $s1)) (result (ref $s2)))) + (type $t2 (;4;) (func (param (ref $s2)) (result (ref $s1)))) + (type (;5;) (func (param (ref $t1)))) + (type (;6;) (func (param (ref $t2)))) (import "N" "f1" (func (;0;) (type 5))) (import "N" "f1" (func (;1;) (type 6))) (import "N" "f2" (func (;2;) (type 5))) diff --git a/tests/snapshots/testsuite/proposals/function-references/type-equivalence.wast/6.print b/tests/snapshots/testsuite/proposals/function-references/type-equivalence.wast/6.print index ea0aae42cf..7a8741b793 100644 --- a/tests/snapshots/testsuite/proposals/function-references/type-equivalence.wast/6.print +++ b/tests/snapshots/testsuite/proposals/function-references/type-equivalence.wast/6.print @@ -1,14 +1,14 @@ (module (type $s0 (;0;) (func (param i32))) - (type $s1 (;1;) (func (param i32 (ref 0)))) - (type $s2 (;2;) (func (param i32 (ref 0)))) - (type $t1 (;3;) (func (param (ref 1)))) - (type $t2 (;4;) (func (param (ref 2)))) + (type $s1 (;1;) (func (param i32 (ref $s0)))) + (type $s2 (;2;) (func (param i32 (ref $s0)))) + (type $t1 (;3;) (func (param (ref $s1)))) + (type $t2 (;4;) (func (param (ref $s2)))) (type (;5;) (func)) - (func $s1 (;0;) (type $s1) (param i32 (ref 0))) - (func $s2 (;1;) (type $s2) (param i32 (ref 0))) - (func $f1 (;2;) (type $t1) (param (ref 1))) - (func $f2 (;3;) (type $t2) (param (ref 2))) + (func $s1 (;0;) (type $s1) (param i32 (ref $s0))) + (func $s2 (;1;) (type $s2) (param i32 (ref $s0))) + (func $f1 (;2;) (type $t1) (param (ref $s1))) + (func $f2 (;3;) (type $t2) (param (ref $s2))) (func (;4;) (type 5) ref.func $s1 i32.const 0 diff --git a/tests/snapshots/testsuite/proposals/function-references/type-equivalence.wast/8.print b/tests/snapshots/testsuite/proposals/function-references/type-equivalence.wast/8.print index 4ecfdf1af0..f9f69387ba 100644 --- a/tests/snapshots/testsuite/proposals/function-references/type-equivalence.wast/8.print +++ b/tests/snapshots/testsuite/proposals/function-references/type-equivalence.wast/8.print @@ -1,6 +1,6 @@ (module (type $t1 (;0;) (func (param f32 f32) (result f32))) - (type (;1;) (func (param (ref 0)))) - (func (;0;) (type 1) (param (ref 0))) + (type (;1;) (func (param (ref $t1)))) + (func (;0;) (type 1) (param (ref $t1))) (export "f" (func 0)) ) diff --git a/tests/snapshots/testsuite/proposals/gc/array.wast/13.print b/tests/snapshots/testsuite/proposals/gc/array.wast/13.print index bbe6f395bf..422c19dbe9 100644 --- a/tests/snapshots/testsuite/proposals/gc/array.wast/13.print +++ b/tests/snapshots/testsuite/proposals/gc/array.wast/13.print @@ -1,19 +1,19 @@ (module (type $vec (;0;) (array f32)) (type $mvec (;1;) (array (mut f32))) - (type (;2;) (func (result (ref 0)))) - (type (;3;) (func (param i32 (ref 0)) (result f32))) + (type (;2;) (func (result (ref $vec)))) + (type (;3;) (func (param i32 (ref $vec)) (result f32))) (type (;4;) (func (param i32) (result f32))) - (type (;5;) (func (param i32 (ref 1) f32) (result f32))) + (type (;5;) (func (param i32 (ref $mvec) f32) (result f32))) (type (;6;) (func (param i32 f32) (result f32))) (type (;7;) (func (param (ref array)) (result i32))) (type (;8;) (func (result i32))) - (func $new (;0;) (type 2) (result (ref 0)) + (func $new (;0;) (type 2) (result (ref $vec)) f32.const 0x1p+0 (;=1;) f32.const 0x1p+1 (;=2;) array.new_fixed $vec 2 ) - (func $get (;1;) (type 3) (param $i i32) (param $v (ref 0)) (result f32) + (func $get (;1;) (type 3) (param $i i32) (param $v (ref $vec)) (result f32) local.get $v local.get $i array.get $vec @@ -23,7 +23,7 @@ call $new call $get ) - (func $set_get (;3;) (type 5) (param $i i32) (param $v (ref 1)) (param $y f32) (result f32) + (func $set_get (;3;) (type 5) (param $i i32) (param $v (ref $mvec)) (param $y f32) (result f32) local.get $v local.get $i local.get $y @@ -49,7 +49,7 @@ call $new call $len ) - (global (;0;) (ref 0) f32.const 0x1p+0 (;=1;) f32.const 0x1p+1 (;=2;) array.new_fixed $vec 2) + (global (;0;) (ref $vec) f32.const 0x1p+0 (;=1;) f32.const 0x1p+1 (;=2;) array.new_fixed $vec 2) (export "new" (func $new)) (export "get" (func 2)) (export "set_get" (func 4)) diff --git a/tests/snapshots/testsuite/proposals/gc/array.wast/2.print b/tests/snapshots/testsuite/proposals/gc/array.wast/2.print index c4879f66b8..4795d00a34 100644 --- a/tests/snapshots/testsuite/proposals/gc/array.wast/2.print +++ b/tests/snapshots/testsuite/proposals/gc/array.wast/2.print @@ -1,9 +1,9 @@ (module (rec - (type $s0 (;0;) (array (ref 1))) - (type $s1 (;1;) (array (ref 0))) + (type $s0 (;0;) (array (ref $s1))) + (type $s1 (;1;) (array (ref $s0))) ) (type $forward (;2;) (array i32)) - (type (;3;) (func (param (ref 2)))) - (func (;0;) (type 3) (param (ref 2))) + (type (;3;) (func (param (ref $forward)))) + (func (;0;) (type 3) (param (ref $forward))) ) diff --git a/tests/snapshots/testsuite/proposals/gc/array.wast/21.print b/tests/snapshots/testsuite/proposals/gc/array.wast/21.print index 2961e616ec..927e520fc5 100644 --- a/tests/snapshots/testsuite/proposals/gc/array.wast/21.print +++ b/tests/snapshots/testsuite/proposals/gc/array.wast/21.print @@ -1,19 +1,19 @@ (module (type $vec (;0;) (array i8)) (type $mvec (;1;) (array (mut i8))) - (type (;2;) (func (result (ref 0)))) - (type (;3;) (func (param i32 (ref 0)) (result i32))) + (type (;2;) (func (result (ref $vec)))) + (type (;3;) (func (param i32 (ref $vec)) (result i32))) (type (;4;) (func (param i32) (result i32))) - (type (;5;) (func (param i32 (ref 1) i32) (result i32))) + (type (;5;) (func (param i32 (ref $mvec) i32) (result i32))) (type (;6;) (func (param i32 i32) (result i32))) (type (;7;) (func (param (ref array)) (result i32))) (type (;8;) (func (result i32))) - (func $new (;0;) (type 2) (result (ref 0)) + (func $new (;0;) (type 2) (result (ref $vec)) i32.const 1 i32.const 3 array.new_data $vec $d ) - (func $get_u (;1;) (type 3) (param $i i32) (param $v (ref 0)) (result i32) + (func $get_u (;1;) (type 3) (param $i i32) (param $v (ref $vec)) (result i32) local.get $v local.get $i array.get_u $vec @@ -23,7 +23,7 @@ call $new call $get_u ) - (func $get_s (;3;) (type 3) (param $i i32) (param $v (ref 0)) (result i32) + (func $get_s (;3;) (type 3) (param $i i32) (param $v (ref $vec)) (result i32) local.get $v local.get $i array.get_s $vec @@ -33,7 +33,7 @@ call $new call $get_s ) - (func $set_get (;5;) (type 5) (param $i i32) (param $v (ref 1)) (param $y i32) (result i32) + (func $set_get (;5;) (type 5) (param $i i32) (param $v (ref $mvec)) (param $y i32) (result i32) local.get $v local.get $i local.get $y diff --git a/tests/snapshots/testsuite/proposals/gc/array.wast/31.print b/tests/snapshots/testsuite/proposals/gc/array.wast/31.print index 48f0cafd34..74f431fa8a 100644 --- a/tests/snapshots/testsuite/proposals/gc/array.wast/31.print +++ b/tests/snapshots/testsuite/proposals/gc/array.wast/31.print @@ -1,34 +1,34 @@ (module (type $bvec (;0;) (array i8)) - (type $vec (;1;) (array (ref 0))) - (type $mvec (;2;) (array (mut (ref 0)))) - (type $nvec (;3;) (array (ref null 0))) + (type $vec (;1;) (array (ref $bvec))) + (type $mvec (;2;) (array (mut (ref $bvec)))) + (type $nvec (;3;) (array (ref null $bvec))) (type $avec (;4;) (array (mut anyref))) - (type (;5;) (func (result (ref 1)))) - (type (;6;) (func (result (ref 3)))) - (type (;7;) (func (result (ref 4)))) - (type (;8;) (func (param i32 i32 (ref 1)) (result i32))) + (type (;5;) (func (result (ref $vec)))) + (type (;6;) (func (result (ref $nvec)))) + (type (;7;) (func (result (ref $avec)))) + (type (;8;) (func (param i32 i32 (ref $vec)) (result i32))) (type (;9;) (func (param i32 i32) (result i32))) - (type (;10;) (func (param i32 i32 (ref 2) i32) (result i32))) + (type (;10;) (func (param i32 i32 (ref $mvec) i32) (result i32))) (type (;11;) (func (param i32 i32 i32) (result i32))) (type (;12;) (func (param (ref array)) (result i32))) (type (;13;) (func (result i32))) - (func $new (;0;) (type 5) (result (ref 1)) + (func $new (;0;) (type 5) (result (ref $vec)) i32.const 0 i32.const 2 array.new_elem $vec $e ) - (func $sub1 (;1;) (type 6) (result (ref 3)) + (func $sub1 (;1;) (type 6) (result (ref $nvec)) i32.const 0 i32.const 2 array.new_elem $nvec $e ) - (func $sub2 (;2;) (type 7) (result (ref 4)) + (func $sub2 (;2;) (type 7) (result (ref $avec)) i32.const 0 i32.const 2 array.new_elem $avec $e ) - (func $get (;3;) (type 8) (param $i i32) (param $j i32) (param $v (ref 1)) (result i32) + (func $get (;3;) (type 8) (param $i i32) (param $j i32) (param $v (ref $vec)) (result i32) local.get $v local.get $i array.get $vec @@ -41,7 +41,7 @@ call $new call $get ) - (func $set_get (;5;) (type 10) (param $i i32) (param $j i32) (param $v (ref 2)) (param $y i32) (result i32) + (func $set_get (;5;) (type 10) (param $i i32) (param $j i32) (param $v (ref $mvec)) (param $y i32) (result i32) local.get $v local.get $i local.get $v @@ -75,5 +75,5 @@ (export "get" (func 4)) (export "set_get" (func 6)) (export "len" (func 8)) - (elem $e (;0;) (ref 0) (item i32.const 7 i32.const 3 array.new $bvec) (item i32.const 1 i32.const 2 array.new_fixed $bvec 2)) + (elem $e (;0;) (ref $bvec) (item i32.const 7 i32.const 3 array.new $bvec) (item i32.const 1 i32.const 2 array.new_fixed $bvec 2)) ) diff --git a/tests/snapshots/testsuite/proposals/gc/array.wast/43.print b/tests/snapshots/testsuite/proposals/gc/array.wast/43.print index 0214dcc520..395ecc153f 100644 --- a/tests/snapshots/testsuite/proposals/gc/array.wast/43.print +++ b/tests/snapshots/testsuite/proposals/gc/array.wast/43.print @@ -2,14 +2,14 @@ (type $t (;0;) (array (mut i32))) (type (;1;) (func)) (func (;0;) (type 1) - (local (ref null 0)) + (local (ref null $t)) local.get 0 i32.const 0 array.get $t drop ) (func (;1;) (type 1) - (local (ref null 0)) + (local (ref null $t)) local.get 0 i32.const 0 i32.const 0 diff --git a/tests/snapshots/testsuite/proposals/gc/array.wast/5.print b/tests/snapshots/testsuite/proposals/gc/array.wast/5.print index 4d9521d39f..97a18bb8f7 100644 --- a/tests/snapshots/testsuite/proposals/gc/array.wast/5.print +++ b/tests/snapshots/testsuite/proposals/gc/array.wast/5.print @@ -1,18 +1,18 @@ (module (type $vec (;0;) (array f32)) (type $mvec (;1;) (array (mut f32))) - (type (;2;) (func (result (ref 0)))) - (type (;3;) (func (param i32 (ref 0)) (result f32))) + (type (;2;) (func (result (ref $vec)))) + (type (;3;) (func (param i32 (ref $vec)) (result f32))) (type (;4;) (func (param i32) (result f32))) - (type (;5;) (func (param i32 (ref 1) f32) (result f32))) + (type (;5;) (func (param i32 (ref $mvec) f32) (result f32))) (type (;6;) (func (param i32 f32) (result f32))) (type (;7;) (func (param (ref array)) (result i32))) (type (;8;) (func (result i32))) - (func $new (;0;) (type 2) (result (ref 0)) + (func $new (;0;) (type 2) (result (ref $vec)) i32.const 3 array.new_default $vec ) - (func $get (;1;) (type 3) (param $i i32) (param $v (ref 0)) (result f32) + (func $get (;1;) (type 3) (param $i i32) (param $v (ref $vec)) (result f32) local.get $v local.get $i array.get $vec @@ -22,7 +22,7 @@ call $new call $get ) - (func $set_get (;3;) (type 5) (param $i i32) (param $v (ref 1)) (param $y f32) (result f32) + (func $set_get (;3;) (type 5) (param $i i32) (param $v (ref $mvec)) (param $y f32) (result f32) local.get $v local.get $i local.get $y @@ -46,8 +46,8 @@ call $new call $len ) - (global (;0;) (ref 0) f32.const 0x1p+0 (;=1;) i32.const 3 array.new $vec) - (global (;1;) (ref 0) i32.const 3 array.new_default $vec) + (global (;0;) (ref $vec) f32.const 0x1p+0 (;=1;) i32.const 3 array.new $vec) + (global (;1;) (ref $vec) i32.const 3 array.new_default $vec) (export "new" (func $new)) (export "get" (func 2)) (export "set_get" (func 4)) diff --git a/tests/snapshots/testsuite/proposals/gc/array_copy.wast/4.print b/tests/snapshots/testsuite/proposals/gc/array_copy.wast/4.print index 209dbd0d30..8c7870cc0e 100644 --- a/tests/snapshots/testsuite/proposals/gc/array_copy.wast/4.print +++ b/tests/snapshots/testsuite/proposals/gc/array_copy.wast/4.print @@ -10,7 +10,7 @@ array.get_u $arr8_mut ) (func (;1;) (type 3) - ref.null 1 + ref.null $arr8_mut i32.const 0 global.get $g_arr8 i32.const 0 @@ -20,7 +20,7 @@ (func (;2;) (type 3) global.get $g_arr8_mut i32.const 0 - ref.null 0 + ref.null $arr8 i32.const 0 i32.const 0 array.copy $arr8_mut $arr8 @@ -34,7 +34,7 @@ array.copy $arr8_mut $arr8 ) (func (;4;) (type 3) - (local $1 (ref 1)) + (local $1 (ref $arr8_mut)) i32.const 0 i32.const 12 array.new_data $arr8_mut $d1 @@ -49,7 +49,7 @@ global.set $g_arr8_mut ) (func (;5;) (type 3) - (local $1 (ref 1)) + (local $1 (ref $arr8_mut)) i32.const 0 i32.const 12 array.new_data $arr8_mut $d1 @@ -63,8 +63,8 @@ local.get $1 global.set $g_arr8_mut ) - (global $g_arr8 (;0;) (ref 0) i32.const 10 i32.const 12 array.new $arr8) - (global $g_arr8_mut (;1;) (mut (ref 1)) i32.const 12 array.new_default $arr8_mut) + (global $g_arr8 (;0;) (ref $arr8) i32.const 10 i32.const 12 array.new $arr8) + (global $g_arr8_mut (;1;) (mut (ref $arr8_mut)) i32.const 12 array.new_default $arr8_mut) (export "array_get_nth" (func 0)) (export "array_copy-null-left" (func 1)) (export "array_copy-null-right" (func 2)) diff --git a/tests/snapshots/testsuite/proposals/gc/array_fill.wast/3.print b/tests/snapshots/testsuite/proposals/gc/array_fill.wast/3.print index c5d59f6505..e6c8602d9c 100644 --- a/tests/snapshots/testsuite/proposals/gc/array_fill.wast/3.print +++ b/tests/snapshots/testsuite/proposals/gc/array_fill.wast/3.print @@ -10,7 +10,7 @@ array.get_u $arr8_mut ) (func (;1;) (type 3) - ref.null 1 + ref.null $arr8_mut i32.const 0 i32.const 0 i32.const 0 @@ -23,8 +23,8 @@ local.get $3 array.fill $arr8_mut ) - (global $g_arr8 (;0;) (ref 0) i32.const 10 i32.const 12 array.new $arr8) - (global $g_arr8_mut (;1;) (mut (ref 1)) i32.const 12 array.new_default $arr8_mut) + (global $g_arr8 (;0;) (ref $arr8) i32.const 10 i32.const 12 array.new $arr8) + (global $g_arr8_mut (;1;) (mut (ref $arr8_mut)) i32.const 12 array.new_default $arr8_mut) (export "array_get_nth" (func 0)) (export "array_fill-null" (func 1)) (export "array_fill" (func 2)) diff --git a/tests/snapshots/testsuite/proposals/gc/array_init_data.wast/2.print b/tests/snapshots/testsuite/proposals/gc/array_init_data.wast/2.print index e0336b66cc..a9e9f95451 100644 --- a/tests/snapshots/testsuite/proposals/gc/array_init_data.wast/2.print +++ b/tests/snapshots/testsuite/proposals/gc/array_init_data.wast/2.print @@ -16,7 +16,7 @@ array.get_u $arr16_mut ) (func (;2;) (type 4) - ref.null 1 + ref.null $arr8_mut i32.const 0 i32.const 0 i32.const 0 @@ -39,9 +39,9 @@ (func (;5;) (type 4) data.drop $d1 ) - (global $g_arr8 (;0;) (ref 0) i32.const 10 i32.const 12 array.new $arr8) - (global $g_arr8_mut (;1;) (mut (ref 1)) i32.const 12 array.new_default $arr8_mut) - (global $g_arr16_mut (;2;) (ref 2) i32.const 6 array.new_default $arr16_mut) + (global $g_arr8 (;0;) (ref $arr8) i32.const 10 i32.const 12 array.new $arr8) + (global $g_arr8_mut (;1;) (mut (ref $arr8_mut)) i32.const 12 array.new_default $arr8_mut) + (global $g_arr16_mut (;2;) (ref $arr16_mut) i32.const 6 array.new_default $arr16_mut) (export "array_get_nth" (func 0)) (export "array_get_nth_i16" (func 1)) (export "array_init_data-null" (func 2)) diff --git a/tests/snapshots/testsuite/proposals/gc/array_init_elem.wast/3.print b/tests/snapshots/testsuite/proposals/gc/array_init_elem.wast/3.print index 6a69f7b68c..392c3fbeb5 100644 --- a/tests/snapshots/testsuite/proposals/gc/array_init_elem.wast/3.print +++ b/tests/snapshots/testsuite/proposals/gc/array_init_elem.wast/3.print @@ -1,6 +1,6 @@ (module (type $t_f (;0;) (func)) - (type $arrref (;1;) (array (ref 0))) + (type $arrref (;1;) (array (ref $t_f))) (type $arrref_mut (;2;) (array (mut funcref))) (type (;3;) (func (param i32))) (type (;4;) (func (param i32 i32 i32))) @@ -15,7 +15,7 @@ call_indirect (type $t_f) ) (func (;2;) (type $t_f) - ref.null 2 + ref.null $arrref_mut i32.const 0 i32.const 0 i32.const 0 @@ -32,8 +32,8 @@ elem.drop $e1 ) (table $t (;0;) 1 funcref) - (global $g_arrref (;0;) (ref 1) ref.func $dummy i32.const 12 array.new $arrref) - (global $g_arrref_mut (;1;) (ref 2) i32.const 12 array.new_default $arrref_mut) + (global $g_arrref (;0;) (ref $arrref) ref.func $dummy i32.const 12 array.new $arrref) + (global $g_arrref_mut (;1;) (ref $arrref_mut) i32.const 12 array.new_default $arrref_mut) (export "array_call_nth" (func 1)) (export "array_init_elem-null" (func 2)) (export "array_init_elem" (func 3)) diff --git a/tests/snapshots/testsuite/proposals/gc/br_on_cast.wast/0.print b/tests/snapshots/testsuite/proposals/gc/br_on_cast.wast/0.print index 30ca66fbe4..b04f4513ea 100644 --- a/tests/snapshots/testsuite/proposals/gc/br_on_cast.wast/0.print +++ b/tests/snapshots/testsuite/proposals/gc/br_on_cast.wast/0.print @@ -4,8 +4,8 @@ (type $at (;2;) (array i8)) (type (;3;) (func (param externref))) (type (;4;) (func (param i32) (result i32))) - (type (;5;) (func (param structref) (result (ref 1)))) - (type (;6;) (func (param structref) (result (ref 2)))) + (type (;5;) (func (param structref) (result (ref $st)))) + (type (;6;) (func (param structref) (result (ref $at)))) (func $f (;0;) (type $ft) (result i32) i32.const 9 ) @@ -59,10 +59,10 @@ i32.const -1 return end - block $l2 (type 5) (param structref) (result (ref 1)) - block $l3 (type 6) (param structref) (result (ref 2)) - br_on_cast $l2 structref (ref 1) - br_on_cast $l3 anyref (ref 2) + block $l2 (type 5) (param structref) (result (ref $st)) + block $l3 (type 6) (param structref) (result (ref $at)) + br_on_cast $l2 structref (ref $st) + br_on_cast $l3 anyref (ref $at) i32.const -2 return end diff --git a/tests/snapshots/testsuite/proposals/gc/br_on_cast.wast/27.print b/tests/snapshots/testsuite/proposals/gc/br_on_cast.wast/27.print index abe40b9093..94106f3988 100644 --- a/tests/snapshots/testsuite/proposals/gc/br_on_cast.wast/27.print +++ b/tests/snapshots/testsuite/proposals/gc/br_on_cast.wast/27.print @@ -39,134 +39,134 @@ block $l (result structref) block (result structref) ;; label = @2 ref.null struct - br_on_cast 0 (;@2;) structref (ref 0) + br_on_cast 0 (;@2;) structref (ref $t0) end drop block (result structref) ;; label = @2 i32.const 0 table.get 0 - br_on_cast 0 (;@2;) structref (ref 0) + br_on_cast 0 (;@2;) structref (ref $t0) end drop block (result structref) ;; label = @2 i32.const 1 table.get 0 - br_on_cast 0 (;@2;) structref (ref 0) + br_on_cast 0 (;@2;) structref (ref $t0) end drop block (result structref) ;; label = @2 i32.const 2 table.get 0 - br_on_cast 0 (;@2;) structref (ref 0) + br_on_cast 0 (;@2;) structref (ref $t0) end drop block (result structref) ;; label = @2 i32.const 3 table.get 0 - br_on_cast 0 (;@2;) structref (ref 0) + br_on_cast 0 (;@2;) structref (ref $t0) end drop block (result structref) ;; label = @2 i32.const 4 table.get 0 - br_on_cast 0 (;@2;) structref (ref 0) + br_on_cast 0 (;@2;) structref (ref $t0) end drop block (result structref) ;; label = @2 ref.null struct - br_on_cast 0 (;@2;) structref (ref 1) + br_on_cast 0 (;@2;) structref (ref $t1) end drop block (result structref) ;; label = @2 i32.const 1 table.get 0 - br_on_cast 0 (;@2;) structref (ref 1) + br_on_cast 0 (;@2;) structref (ref $t1) end drop block (result structref) ;; label = @2 i32.const 2 table.get 0 - br_on_cast 0 (;@2;) structref (ref 1) + br_on_cast 0 (;@2;) structref (ref $t1) end drop block (result structref) ;; label = @2 ref.null struct - br_on_cast 0 (;@2;) structref (ref 3) + br_on_cast 0 (;@2;) structref (ref $t2) end drop block (result structref) ;; label = @2 i32.const 2 table.get 0 - br_on_cast 0 (;@2;) structref (ref 3) + br_on_cast 0 (;@2;) structref (ref $t2) end drop block (result structref) ;; label = @2 ref.null struct - br_on_cast 0 (;@2;) structref (ref 5) + br_on_cast 0 (;@2;) structref (ref $t3) end drop block (result structref) ;; label = @2 i32.const 3 table.get 0 - br_on_cast 0 (;@2;) structref (ref 5) + br_on_cast 0 (;@2;) structref (ref $t3) end drop block (result structref) ;; label = @2 ref.null struct - br_on_cast 0 (;@2;) structref (ref 7) + br_on_cast 0 (;@2;) structref (ref $t4) end drop block (result structref) ;; label = @2 i32.const 4 table.get 0 - br_on_cast 0 (;@2;) structref (ref 7) + br_on_cast 0 (;@2;) structref (ref $t4) end drop i32.const 0 table.get 0 - br_on_cast $l anyref (ref 1) + br_on_cast $l anyref (ref $t1) i32.const 3 table.get 0 - br_on_cast $l anyref (ref 1) + br_on_cast $l anyref (ref $t1) i32.const 4 table.get 0 - br_on_cast $l anyref (ref 1) + br_on_cast $l anyref (ref $t1) i32.const 0 table.get 0 - br_on_cast $l anyref (ref 3) + br_on_cast $l anyref (ref $t2) i32.const 1 table.get 0 - br_on_cast $l anyref (ref 3) + br_on_cast $l anyref (ref $t2) i32.const 3 table.get 0 - br_on_cast $l anyref (ref 3) + br_on_cast $l anyref (ref $t2) i32.const 4 table.get 0 - br_on_cast $l anyref (ref 3) + br_on_cast $l anyref (ref $t2) i32.const 0 table.get 0 - br_on_cast $l anyref (ref 5) + br_on_cast $l anyref (ref $t3) i32.const 1 table.get 0 - br_on_cast $l anyref (ref 5) + br_on_cast $l anyref (ref $t3) i32.const 2 table.get 0 - br_on_cast $l anyref (ref 5) + br_on_cast $l anyref (ref $t3) i32.const 4 table.get 0 - br_on_cast $l anyref (ref 5) + br_on_cast $l anyref (ref $t3) i32.const 0 table.get 0 - br_on_cast $l anyref (ref 7) + br_on_cast $l anyref (ref $t4) i32.const 1 table.get 0 - br_on_cast $l anyref (ref 7) + br_on_cast $l anyref (ref $t4) i32.const 2 table.get 0 - br_on_cast $l anyref (ref 7) + br_on_cast $l anyref (ref $t4) i32.const 3 table.get 0 - br_on_cast $l anyref (ref 7) + br_on_cast $l anyref (ref $t4) return end unreachable @@ -177,85 +177,85 @@ block (result structref) ;; label = @2 i32.const 0 table.get 0 - br_on_cast 0 (;@2;) structref (ref 6) + br_on_cast 0 (;@2;) structref (ref $t0') end drop block (result structref) ;; label = @2 i32.const 1 table.get 0 - br_on_cast 0 (;@2;) structref (ref 6) + br_on_cast 0 (;@2;) structref (ref $t0') end drop block (result structref) ;; label = @2 i32.const 2 table.get 0 - br_on_cast 0 (;@2;) structref (ref 6) + br_on_cast 0 (;@2;) structref (ref $t0') end drop block (result structref) ;; label = @2 i32.const 3 table.get 0 - br_on_cast 0 (;@2;) structref (ref 6) + br_on_cast 0 (;@2;) structref (ref $t0') end drop block (result structref) ;; label = @2 i32.const 4 table.get 0 - br_on_cast 0 (;@2;) structref (ref 6) + br_on_cast 0 (;@2;) structref (ref $t0') end drop block (result structref) ;; label = @2 i32.const 10 table.get 0 - br_on_cast 0 (;@2;) structref (ref 0) + br_on_cast 0 (;@2;) structref (ref $t0) end drop block (result structref) ;; label = @2 i32.const 11 table.get 0 - br_on_cast 0 (;@2;) structref (ref 0) + br_on_cast 0 (;@2;) structref (ref $t0) end drop block (result structref) ;; label = @2 i32.const 12 table.get 0 - br_on_cast 0 (;@2;) structref (ref 0) + br_on_cast 0 (;@2;) structref (ref $t0) end drop block (result structref) ;; label = @2 i32.const 1 table.get 0 - br_on_cast 0 (;@2;) structref (ref 2) + br_on_cast 0 (;@2;) structref (ref $t1') end drop block (result structref) ;; label = @2 i32.const 2 table.get 0 - br_on_cast 0 (;@2;) structref (ref 2) + br_on_cast 0 (;@2;) structref (ref $t1') end drop block (result structref) ;; label = @2 i32.const 11 table.get 0 - br_on_cast 0 (;@2;) structref (ref 1) + br_on_cast 0 (;@2;) structref (ref $t1) end drop block (result structref) ;; label = @2 i32.const 12 table.get 0 - br_on_cast 0 (;@2;) structref (ref 1) + br_on_cast 0 (;@2;) structref (ref $t1) end drop block (result structref) ;; label = @2 i32.const 2 table.get 0 - br_on_cast 0 (;@2;) structref (ref 4) + br_on_cast 0 (;@2;) structref (ref $t2') end drop block (result structref) ;; label = @2 i32.const 12 table.get 0 - br_on_cast 0 (;@2;) structref (ref 3) + br_on_cast 0 (;@2;) structref (ref $t2) end drop return diff --git a/tests/snapshots/testsuite/proposals/gc/br_on_cast.wast/30.print b/tests/snapshots/testsuite/proposals/gc/br_on_cast.wast/30.print index 831a7899ac..3a73454667 100644 --- a/tests/snapshots/testsuite/proposals/gc/br_on_cast.wast/30.print +++ b/tests/snapshots/testsuite/proposals/gc/br_on_cast.wast/30.print @@ -1,26 +1,26 @@ (module (type $t (;0;) (struct)) - (type (;1;) (func (param (ref any)) (result (ref 0)))) - (type (;2;) (func (param anyref) (result (ref 0)))) - (type (;3;) (func (param anyref) (result (ref null 0)))) - (func (;0;) (type 1) (param (ref any)) (result (ref 0)) + (type (;1;) (func (param (ref any)) (result (ref $t)))) + (type (;2;) (func (param anyref) (result (ref $t)))) + (type (;3;) (func (param anyref) (result (ref null $t)))) + (func (;0;) (type 1) (param (ref any)) (result (ref $t)) block (result (ref any)) ;; label = @1 local.get 0 - br_on_cast 1 (;@0;) (ref any) (ref 0) + br_on_cast 1 (;@0;) (ref any) (ref $t) end unreachable ) - (func (;1;) (type 2) (param anyref) (result (ref 0)) + (func (;1;) (type 2) (param anyref) (result (ref $t)) block (result anyref) ;; label = @1 local.get 0 - br_on_cast 1 (;@0;) anyref (ref 0) + br_on_cast 1 (;@0;) anyref (ref $t) end unreachable ) - (func (;2;) (type 3) (param anyref) (result (ref null 0)) + (func (;2;) (type 3) (param anyref) (result (ref null $t)) block (result anyref) ;; label = @1 local.get 0 - br_on_cast 1 (;@0;) anyref (ref null 0) + br_on_cast 1 (;@0;) anyref (ref null $t) end unreachable ) diff --git a/tests/snapshots/testsuite/proposals/gc/br_on_cast_fail.wast/0.print b/tests/snapshots/testsuite/proposals/gc/br_on_cast_fail.wast/0.print index ee2b40d72d..6074cb4bf0 100644 --- a/tests/snapshots/testsuite/proposals/gc/br_on_cast_fail.wast/0.print +++ b/tests/snapshots/testsuite/proposals/gc/br_on_cast_fail.wast/0.print @@ -4,8 +4,8 @@ (type $at (;2;) (array i8)) (type (;3;) (func (param externref))) (type (;4;) (func (param i32) (result i32))) - (type (;5;) (func (param structref) (result (ref 1)))) - (type (;6;) (func (param structref) (result (ref 2)))) + (type (;5;) (func (param structref) (result (ref $st)))) + (type (;6;) (func (param structref) (result (ref $at)))) (func $f (;0;) (type $ft) (result i32) i32.const 9 ) @@ -58,10 +58,10 @@ local.get $i table.get 0 br_on_cast_fail $l anyref (ref struct) - block $l2 (type 5) (param structref) (result (ref 1)) - block $l3 (type 6) (param structref) (result (ref 2)) - br_on_cast $l2 structref (ref 1) - br_on_cast $l3 anyref (ref 2) + block $l2 (type 5) (param structref) (result (ref $st)) + block $l3 (type 6) (param structref) (result (ref $at)) + br_on_cast $l2 structref (ref $st) + br_on_cast $l3 anyref (ref $at) i32.const -2 return end diff --git a/tests/snapshots/testsuite/proposals/gc/br_on_cast_fail.wast/27.print b/tests/snapshots/testsuite/proposals/gc/br_on_cast_fail.wast/27.print index eb93a81e21..48f56789a3 100644 --- a/tests/snapshots/testsuite/proposals/gc/br_on_cast_fail.wast/27.print +++ b/tests/snapshots/testsuite/proposals/gc/br_on_cast_fail.wast/27.print @@ -38,188 +38,188 @@ call $init block $l (result structref) ref.null struct - br_on_cast_fail $l structref (ref null 0) + br_on_cast_fail $l structref (ref null $t0) i32.const 0 table.get 0 - br_on_cast_fail $l structref (ref null 0) + br_on_cast_fail $l structref (ref null $t0) i32.const 1 table.get 0 - br_on_cast_fail $l structref (ref null 0) + br_on_cast_fail $l structref (ref null $t0) i32.const 2 table.get 0 - br_on_cast_fail $l structref (ref null 0) + br_on_cast_fail $l structref (ref null $t0) i32.const 3 table.get 0 - br_on_cast_fail $l structref (ref null 0) + br_on_cast_fail $l structref (ref null $t0) i32.const 4 table.get 0 - br_on_cast_fail $l structref (ref null 0) + br_on_cast_fail $l structref (ref null $t0) i32.const 0 table.get 0 - br_on_cast_fail $l structref (ref 0) + br_on_cast_fail $l structref (ref $t0) i32.const 1 table.get 0 - br_on_cast_fail $l structref (ref 0) + br_on_cast_fail $l structref (ref $t0) i32.const 2 table.get 0 - br_on_cast_fail $l structref (ref 0) + br_on_cast_fail $l structref (ref $t0) i32.const 3 table.get 0 - br_on_cast_fail $l structref (ref 0) + br_on_cast_fail $l structref (ref $t0) i32.const 4 table.get 0 - br_on_cast_fail $l structref (ref 0) + br_on_cast_fail $l structref (ref $t0) ref.null struct - br_on_cast_fail $l structref (ref null 1) + br_on_cast_fail $l structref (ref null $t1) i32.const 1 table.get 0 - br_on_cast_fail $l structref (ref null 1) + br_on_cast_fail $l structref (ref null $t1) i32.const 2 table.get 0 - br_on_cast_fail $l structref (ref null 1) + br_on_cast_fail $l structref (ref null $t1) i32.const 1 table.get 0 - br_on_cast_fail $l structref (ref 1) + br_on_cast_fail $l structref (ref $t1) i32.const 2 table.get 0 - br_on_cast_fail $l structref (ref 1) + br_on_cast_fail $l structref (ref $t1) ref.null struct - br_on_cast_fail $l structref (ref null 3) + br_on_cast_fail $l structref (ref null $t2) i32.const 2 table.get 0 - br_on_cast_fail $l structref (ref null 3) + br_on_cast_fail $l structref (ref null $t2) i32.const 2 table.get 0 - br_on_cast_fail $l structref (ref 3) + br_on_cast_fail $l structref (ref $t2) ref.null struct - br_on_cast_fail $l structref (ref null 5) + br_on_cast_fail $l structref (ref null $t3) i32.const 3 table.get 0 - br_on_cast_fail $l structref (ref null 5) + br_on_cast_fail $l structref (ref null $t3) i32.const 3 table.get 0 - br_on_cast_fail $l structref (ref 5) + br_on_cast_fail $l structref (ref $t3) ref.null struct - br_on_cast_fail $l structref (ref null 7) + br_on_cast_fail $l structref (ref null $t4) i32.const 4 table.get 0 - br_on_cast_fail $l structref (ref null 7) + br_on_cast_fail $l structref (ref null $t4) i32.const 4 table.get 0 - br_on_cast_fail $l structref (ref 7) + br_on_cast_fail $l structref (ref $t4) block (result structref) ;; label = @2 ref.null struct - br_on_cast_fail 0 (;@2;) structref (ref 0) + br_on_cast_fail 0 (;@2;) structref (ref $t0) end drop block (result structref) ;; label = @2 ref.null struct - br_on_cast_fail 0 (;@2;) structref (ref 1) + br_on_cast_fail 0 (;@2;) structref (ref $t1) end drop block (result structref) ;; label = @2 i32.const 0 table.get 0 - br_on_cast_fail 0 (;@2;) structref (ref 1) + br_on_cast_fail 0 (;@2;) structref (ref $t1) end drop block (result structref) ;; label = @2 i32.const 3 table.get 0 - br_on_cast_fail 0 (;@2;) structref (ref 1) + br_on_cast_fail 0 (;@2;) structref (ref $t1) end drop block (result structref) ;; label = @2 i32.const 4 table.get 0 - br_on_cast_fail 0 (;@2;) structref (ref 1) + br_on_cast_fail 0 (;@2;) structref (ref $t1) end drop block (result structref) ;; label = @2 ref.null struct - br_on_cast_fail 0 (;@2;) structref (ref 3) + br_on_cast_fail 0 (;@2;) structref (ref $t2) end drop block (result structref) ;; label = @2 i32.const 0 table.get 0 - br_on_cast_fail 0 (;@2;) structref (ref 3) + br_on_cast_fail 0 (;@2;) structref (ref $t2) end drop block (result structref) ;; label = @2 i32.const 1 table.get 0 - br_on_cast_fail 0 (;@2;) structref (ref 3) + br_on_cast_fail 0 (;@2;) structref (ref $t2) end drop block (result structref) ;; label = @2 i32.const 3 table.get 0 - br_on_cast_fail 0 (;@2;) structref (ref 3) + br_on_cast_fail 0 (;@2;) structref (ref $t2) end drop block (result structref) ;; label = @2 i32.const 4 table.get 0 - br_on_cast_fail 0 (;@2;) structref (ref 3) + br_on_cast_fail 0 (;@2;) structref (ref $t2) end drop block (result structref) ;; label = @2 ref.null struct - br_on_cast_fail 0 (;@2;) structref (ref 5) + br_on_cast_fail 0 (;@2;) structref (ref $t3) end drop block (result structref) ;; label = @2 i32.const 0 table.get 0 - br_on_cast_fail 0 (;@2;) structref (ref 5) + br_on_cast_fail 0 (;@2;) structref (ref $t3) end drop block (result structref) ;; label = @2 i32.const 1 table.get 0 - br_on_cast_fail 0 (;@2;) structref (ref 5) + br_on_cast_fail 0 (;@2;) structref (ref $t3) end drop block (result structref) ;; label = @2 i32.const 2 table.get 0 - br_on_cast_fail 0 (;@2;) structref (ref 5) + br_on_cast_fail 0 (;@2;) structref (ref $t3) end drop block (result structref) ;; label = @2 i32.const 4 table.get 0 - br_on_cast_fail 0 (;@2;) structref (ref 5) + br_on_cast_fail 0 (;@2;) structref (ref $t3) end drop block (result structref) ;; label = @2 ref.null struct - br_on_cast_fail 0 (;@2;) structref (ref 7) + br_on_cast_fail 0 (;@2;) structref (ref $t4) end drop block (result structref) ;; label = @2 i32.const 0 table.get 0 - br_on_cast_fail 0 (;@2;) structref (ref 7) + br_on_cast_fail 0 (;@2;) structref (ref $t4) end drop block (result structref) ;; label = @2 i32.const 1 table.get 0 - br_on_cast_fail 0 (;@2;) structref (ref 7) + br_on_cast_fail 0 (;@2;) structref (ref $t4) end drop block (result structref) ;; label = @2 i32.const 2 table.get 0 - br_on_cast_fail 0 (;@2;) structref (ref 7) + br_on_cast_fail 0 (;@2;) structref (ref $t4) end drop block (result structref) ;; label = @2 i32.const 3 table.get 0 - br_on_cast_fail 0 (;@2;) structref (ref 7) + br_on_cast_fail 0 (;@2;) structref (ref $t4) end drop return @@ -231,46 +231,46 @@ block $l (result structref) i32.const 0 table.get 0 - br_on_cast_fail $l structref (ref 0) + br_on_cast_fail $l structref (ref $t0) i32.const 1 table.get 0 - br_on_cast_fail $l structref (ref 0) + br_on_cast_fail $l structref (ref $t0) i32.const 2 table.get 0 - br_on_cast_fail $l structref (ref 0) + br_on_cast_fail $l structref (ref $t0) i32.const 3 table.get 0 - br_on_cast_fail $l structref (ref 0) + br_on_cast_fail $l structref (ref $t0) i32.const 4 table.get 0 - br_on_cast_fail $l structref (ref 0) + br_on_cast_fail $l structref (ref $t0) i32.const 10 table.get 0 - br_on_cast_fail $l structref (ref 0) + br_on_cast_fail $l structref (ref $t0) i32.const 11 table.get 0 - br_on_cast_fail $l structref (ref 0) + br_on_cast_fail $l structref (ref $t0) i32.const 12 table.get 0 - br_on_cast_fail $l structref (ref 0) + br_on_cast_fail $l structref (ref $t0) i32.const 1 table.get 0 - br_on_cast_fail $l structref (ref 2) + br_on_cast_fail $l structref (ref $t1') i32.const 2 table.get 0 - br_on_cast_fail $l structref (ref 2) + br_on_cast_fail $l structref (ref $t1') i32.const 11 table.get 0 - br_on_cast_fail $l structref (ref 1) + br_on_cast_fail $l structref (ref $t1) i32.const 12 table.get 0 - br_on_cast_fail $l structref (ref 1) + br_on_cast_fail $l structref (ref $t1) i32.const 2 table.get 0 - br_on_cast_fail $l structref (ref 4) + br_on_cast_fail $l structref (ref $t2') i32.const 12 table.get 0 - br_on_cast_fail $l structref (ref 3) + br_on_cast_fail $l structref (ref $t2) return end unreachable diff --git a/tests/snapshots/testsuite/proposals/gc/br_on_cast_fail.wast/30.print b/tests/snapshots/testsuite/proposals/gc/br_on_cast_fail.wast/30.print index a5316275b0..37468397b8 100644 --- a/tests/snapshots/testsuite/proposals/gc/br_on_cast_fail.wast/30.print +++ b/tests/snapshots/testsuite/proposals/gc/br_on_cast_fail.wast/30.print @@ -3,21 +3,21 @@ (type (;1;) (func (param (ref any)) (result (ref any)))) (type (;2;) (func (param anyref) (result anyref))) (func (;0;) (type 1) (param (ref any)) (result (ref any)) - block (result (ref 0)) ;; label = @1 + block (result (ref $t)) ;; label = @1 local.get 0 - br_on_cast_fail 1 (;@0;) (ref any) (ref 0) + br_on_cast_fail 1 (;@0;) (ref any) (ref $t) end ) (func (;1;) (type 2) (param anyref) (result anyref) - block (result (ref 0)) ;; label = @1 + block (result (ref $t)) ;; label = @1 local.get 0 - br_on_cast_fail 1 (;@0;) anyref (ref 0) + br_on_cast_fail 1 (;@0;) anyref (ref $t) end ) (func (;2;) (type 2) (param anyref) (result anyref) - block (result (ref null 0)) ;; label = @1 + block (result (ref null $t)) ;; label = @1 local.get 0 - br_on_cast_fail 1 (;@0;) anyref (ref null 0) + br_on_cast_fail 1 (;@0;) anyref (ref null $t) end ) ) diff --git a/tests/snapshots/testsuite/proposals/gc/br_on_non_null.wast/0.print b/tests/snapshots/testsuite/proposals/gc/br_on_non_null.wast/0.print index e0329c705e..c31166a513 100644 --- a/tests/snapshots/testsuite/proposals/gc/br_on_non_null.wast/0.print +++ b/tests/snapshots/testsuite/proposals/gc/br_on_non_null.wast/0.print @@ -1,9 +1,9 @@ (module (type $t (;0;) (func (result i32))) - (type (;1;) (func (param (ref 0)) (result i32))) - (type (;2;) (func (param (ref null 0)) (result i32))) - (func $nn (;0;) (type 1) (param $r (ref 0)) (result i32) - block $l (result (ref 0)) + (type (;1;) (func (param (ref $t)) (result i32))) + (type (;2;) (func (param (ref null $t)) (result i32))) + (func $nn (;0;) (type 1) (param $r (ref $t)) (result i32) + block $l (result (ref $t)) local.get $r br_on_non_null $l i32.const -1 @@ -11,8 +11,8 @@ end call_ref $t ) - (func $n (;1;) (type 2) (param $r (ref null 0)) (result i32) - block $l (result (ref 0)) + (func $n (;1;) (type 2) (param $r (ref null $t)) (result i32) + block $l (result (ref $t)) local.get $r br_on_non_null $l i32.const -1 @@ -24,7 +24,7 @@ i32.const 7 ) (func (;3;) (type $t) (result i32) - ref.null 0 + ref.null $t call $n ) (func (;4;) (type $t) (result i32) @@ -36,7 +36,7 @@ call $n ) (func (;6;) (type $t) (result i32) - block $l (result (ref 0)) + block $l (result (ref $t)) unreachable br_on_non_null $l i32.const -1 diff --git a/tests/snapshots/testsuite/proposals/gc/br_on_non_null.wast/5.print b/tests/snapshots/testsuite/proposals/gc/br_on_non_null.wast/5.print index 08dc0edf52..bea13444c9 100644 --- a/tests/snapshots/testsuite/proposals/gc/br_on_non_null.wast/5.print +++ b/tests/snapshots/testsuite/proposals/gc/br_on_non_null.wast/5.print @@ -1,10 +1,10 @@ (module (type $t (;0;) (func)) - (type (;1;) (func (param (ref null 0)))) + (type (;1;) (func (param (ref null $t)))) (type (;2;) (func (param funcref))) (type (;3;) (func (param externref))) - (func (;0;) (type 1) (param $r (ref null 0)) - block (result (ref 0)) ;; label = @1 + (func (;0;) (type 1) (param $r (ref null $t)) + block (result (ref $t)) ;; label = @1 local.get $r br_on_non_null 0 (;@1;) unreachable diff --git a/tests/snapshots/testsuite/proposals/gc/br_on_non_null.wast/6.print b/tests/snapshots/testsuite/proposals/gc/br_on_non_null.wast/6.print index a0185721b8..fd25db678c 100644 --- a/tests/snapshots/testsuite/proposals/gc/br_on_non_null.wast/6.print +++ b/tests/snapshots/testsuite/proposals/gc/br_on_non_null.wast/6.print @@ -1,14 +1,14 @@ (module (type $t (;0;) (func (param i32) (result i32))) - (type (;1;) (func (param i32 (ref null 0)) (result i32))) - (type (;2;) (func (result i32 (ref 0)))) + (type (;1;) (func (param i32 (ref null $t)) (result i32))) + (type (;2;) (func (result i32 (ref $t)))) (func $f (;0;) (type $t) (param i32) (result i32) local.get 0 local.get 0 i32.mul ) - (func $a (;1;) (type 1) (param $n i32) (param $r (ref null 0)) (result i32) - block $l (type 2) (result i32 (ref 0)) + (func $a (;1;) (type 1) (param $n i32) (param $r (ref null $t)) (result i32) + block $l (type 2) (result i32 (ref $t)) local.get $n local.get $r br_on_non_null $l @@ -18,7 +18,7 @@ ) (func (;2;) (type $t) (param $n i32) (result i32) local.get $n - ref.null 0 + ref.null $t call $a ) (func (;3;) (type $t) (param $n i32) (result i32) diff --git a/tests/snapshots/testsuite/proposals/gc/br_on_null.wast/0.print b/tests/snapshots/testsuite/proposals/gc/br_on_null.wast/0.print index 0aa70467fb..be60e9af88 100644 --- a/tests/snapshots/testsuite/proposals/gc/br_on_null.wast/0.print +++ b/tests/snapshots/testsuite/proposals/gc/br_on_null.wast/0.print @@ -1,8 +1,8 @@ (module (type $t (;0;) (func (result i32))) - (type (;1;) (func (param (ref 0)) (result i32))) - (type (;2;) (func (param (ref null 0)) (result i32))) - (func $nn (;0;) (type 1) (param $r (ref 0)) (result i32) + (type (;1;) (func (param (ref $t)) (result i32))) + (type (;2;) (func (param (ref null $t)) (result i32))) + (func $nn (;0;) (type 1) (param $r (ref $t)) (result i32) block $l local.get $r br_on_null $l @@ -11,7 +11,7 @@ end i32.const -1 ) - (func $n (;1;) (type 2) (param $r (ref null 0)) (result i32) + (func $n (;1;) (type 2) (param $r (ref null $t)) (result i32) block $l local.get $r br_on_null $l @@ -24,7 +24,7 @@ i32.const 7 ) (func (;3;) (type $t) (result i32) - ref.null 0 + ref.null $t call $n ) (func (;4;) (type $t) (result i32) diff --git a/tests/snapshots/testsuite/proposals/gc/br_on_null.wast/5.print b/tests/snapshots/testsuite/proposals/gc/br_on_null.wast/5.print index f7ecabad1a..1946ceaca1 100644 --- a/tests/snapshots/testsuite/proposals/gc/br_on_null.wast/5.print +++ b/tests/snapshots/testsuite/proposals/gc/br_on_null.wast/5.print @@ -1,9 +1,9 @@ (module (type $t (;0;) (func)) - (type (;1;) (func (param (ref null 0)))) + (type (;1;) (func (param (ref null $t)))) (type (;2;) (func (param funcref))) (type (;3;) (func (param externref))) - (func (;0;) (type 1) (param $r (ref null 0)) + (func (;0;) (type 1) (param $r (ref null $t)) local.get $r br_on_null 0 (;@0;) drop diff --git a/tests/snapshots/testsuite/proposals/gc/br_on_null.wast/6.print b/tests/snapshots/testsuite/proposals/gc/br_on_null.wast/6.print index 4059e9ee4d..ffab737fcf 100644 --- a/tests/snapshots/testsuite/proposals/gc/br_on_null.wast/6.print +++ b/tests/snapshots/testsuite/proposals/gc/br_on_null.wast/6.print @@ -1,12 +1,12 @@ (module (type $t (;0;) (func (param i32) (result i32))) - (type (;1;) (func (param i32 (ref null 0)) (result i32))) + (type (;1;) (func (param i32 (ref null $t)) (result i32))) (func $f (;0;) (type $t) (param i32) (result i32) local.get 0 local.get 0 i32.mul ) - (func $a (;1;) (type 1) (param $n i32) (param $r (ref null 0)) (result i32) + (func $a (;1;) (type 1) (param $n i32) (param $r (ref null $t)) (result i32) block $l (result i32) local.get $n local.get $r @@ -17,7 +17,7 @@ ) (func (;2;) (type $t) (param $n i32) (result i32) local.get $n - ref.null 0 + ref.null $t call $a ) (func (;3;) (type $t) (param $n i32) (result i32) diff --git a/tests/snapshots/testsuite/proposals/gc/br_table.wast/0.print b/tests/snapshots/testsuite/proposals/gc/br_table.wast/0.print index 2a13061a45..c3603f18ba 100644 --- a/tests/snapshots/testsuite/proposals/gc/br_table.wast/0.print +++ b/tests/snapshots/testsuite/proposals/gc/br_table.wast/0.print @@ -786,7 +786,7 @@ (func $tf (;71;) (type $t)) (func (;72;) (type 9) (param i32) (result funcref) block $l1 (result funcref) - block $l2 (result (ref null 1)) + block $l2 (result (ref null $t)) i32.const 0 table.get $t local.get 0 @@ -796,7 +796,7 @@ ) (func (;73;) (type 9) (param i32) (result funcref) block $l1 (result funcref) - block $l2 (result (ref null 1)) + block $l2 (result (ref null $t)) i32.const 0 table.get $t local.get 0 @@ -806,7 +806,7 @@ ) (func (;74;) (type 9) (param i32) (result funcref) block $l1 (result funcref) - block $l2 (result (ref null 1)) + block $l2 (result (ref null $t)) i32.const 0 table.get $t local.get 0 @@ -816,7 +816,7 @@ ) (func (;75;) (type 9) (param i32) (result funcref) block $l1 (result funcref) - block $l2 (result (ref null 1)) + block $l2 (result (ref null $t)) i32.const 0 table.get $t local.get 0 @@ -826,8 +826,8 @@ ) (func (;76;) (type 9) (param i32) (result funcref) block $l1 (result funcref) - block $l2 (result (ref null 1)) - ref.null 1 + block $l2 (result (ref null $t)) + ref.null $t local.get 0 br_table $l1 $l2 $l1 end @@ -835,8 +835,8 @@ ) (func (;77;) (type 9) (param i32) (result funcref) block $l1 (result funcref) - block $l2 (result (ref null 1)) - block $l3 (result (ref 1)) + block $l2 (result (ref null $t)) + block $l3 (result (ref $t)) ref.func $tf local.get 0 br_table $l3 $l2 $l1 @@ -845,7 +845,7 @@ end ) (table (;0;) 1 1 funcref) - (table $t (;1;) 1 1 (ref null 1)) + (table $t (;1;) 1 1 (ref null $t)) (memory (;0;) 1) (global $a (;0;) (mut i32) i32.const 10) (export "type-i32" (func 1)) @@ -924,5 +924,5 @@ (export "meet-nullref" (func 76)) (export "meet-multi-ref" (func 77)) (elem (;0;) (i32.const 0) func $f) - (elem (;1;) (table $t) (i32.const 0) (ref null 1) (ref.func $tf)) + (elem (;1;) (table $t) (i32.const 0) (ref null $t) (ref.func $tf)) ) diff --git a/tests/snapshots/testsuite/proposals/gc/call_ref.wast/0.print b/tests/snapshots/testsuite/proposals/gc/call_ref.wast/0.print index 620d08529b..b983464ae1 100644 --- a/tests/snapshots/testsuite/proposals/gc/call_ref.wast/0.print +++ b/tests/snapshots/testsuite/proposals/gc/call_ref.wast/0.print @@ -2,9 +2,9 @@ (type $ii (;0;) (func (param i32) (result i32))) (type $ll (;1;) (func (param i64) (result i64))) (type $lll (;2;) (func (param i64 i64) (result i64))) - (type (;3;) (func (param (ref 0) i32) (result i32))) + (type (;3;) (func (param (ref $ii) i32) (result i32))) (type (;4;) (func (result i32))) - (func $apply (;0;) (type 3) (param $f (ref 0)) (param $x i32) (result i32) + (func $apply (;0;) (type 3) (param $f (ref $ii)) (param $x i32) (result i32) local.get $x local.get $f call_ref $ii @@ -20,7 +20,7 @@ i32.sub ) (func (;3;) (type $ii) (param $x i32) (result i32) - (local $rf (ref null 0)) (local $rg (ref null 0)) + (local $rf (ref null $ii)) (local $rg (ref null $ii)) ref.func $f local.set $rf ref.func $g @@ -33,7 +33,7 @@ ) (func (;4;) (type 4) (result i32) i32.const 1 - ref.null 0 + ref.null $ii call_ref $ii ) (func $fac (;5;) (type $ll) (param i64) (result i64) @@ -113,11 +113,11 @@ call_ref $ll end ) - (global $fac (;0;) (ref 1) ref.func $fac) - (global $fac-acc (;1;) (ref 2) ref.func $fac-acc) - (global $fib (;2;) (ref 1) ref.func $fib) - (global $even (;3;) (ref 1) ref.func $even) - (global $odd (;4;) (ref 1) ref.func $odd) + (global $fac (;0;) (ref $ll) ref.func $fac) + (global $fac-acc (;1;) (ref $lll) ref.func $fac-acc) + (global $fib (;2;) (ref $ll) ref.func $fib) + (global $even (;3;) (ref $ll) ref.func $even) + (global $odd (;4;) (ref $ll) ref.func $odd) (export "run" (func 3)) (export "null" (func 4)) (export "fac" (func $fac)) diff --git a/tests/snapshots/testsuite/proposals/gc/linking.wast/120.print b/tests/snapshots/testsuite/proposals/gc/linking.wast/120.print index bd544361ba..23f45e5f9b 100644 --- a/tests/snapshots/testsuite/proposals/gc/linking.wast/120.print +++ b/tests/snapshots/testsuite/proposals/gc/linking.wast/120.print @@ -1,7 +1,7 @@ (module $Mtable_ex (type $t (;0;) (func)) (table (;0;) 1 funcref) - (table (;1;) 1 (ref null 0)) + (table (;1;) 1 (ref null $t)) (table (;2;) 1 externref) (export "t-funcnull" (table 0)) (export "t-refnull" (table 1)) diff --git a/tests/snapshots/testsuite/proposals/gc/linking.wast/122.print b/tests/snapshots/testsuite/proposals/gc/linking.wast/122.print index 224e9aa3d3..45cb1a5857 100644 --- a/tests/snapshots/testsuite/proposals/gc/linking.wast/122.print +++ b/tests/snapshots/testsuite/proposals/gc/linking.wast/122.print @@ -1,6 +1,6 @@ (module (type $t (;0;) (func)) (import "Mtable_ex" "t-funcnull" (table (;0;) 1 funcref)) - (import "Mtable_ex" "t-refnull" (table (;1;) 1 (ref null 0))) + (import "Mtable_ex" "t-refnull" (table (;1;) 1 (ref null $t))) (import "Mtable_ex" "t-extern" (table (;2;) 1 externref)) ) diff --git a/tests/snapshots/testsuite/proposals/gc/linking.wast/31.print b/tests/snapshots/testsuite/proposals/gc/linking.wast/31.print index 60068ec2f1..7c9865ad76 100644 --- a/tests/snapshots/testsuite/proposals/gc/linking.wast/31.print +++ b/tests/snapshots/testsuite/proposals/gc/linking.wast/31.print @@ -3,13 +3,13 @@ (func $f (;0;) (type $t)) (global (;0;) funcref ref.null func) (global (;1;) (ref func) ref.func $f) - (global (;2;) (ref null 0) ref.null 0) - (global (;3;) (ref 0) ref.func $f) + (global (;2;) (ref null $t) ref.null $t) + (global (;3;) (ref $t) ref.func $f) (global (;4;) externref ref.null extern) (global (;5;) (mut funcref) ref.null func) (global (;6;) (mut (ref func)) ref.func $f) - (global (;7;) (mut (ref null 0)) ref.null 0) - (global (;8;) (mut (ref 0)) ref.func $f) + (global (;7;) (mut (ref null $t)) ref.null $t) + (global (;8;) (mut (ref $t)) ref.func $f) (global (;9;) (mut externref) ref.null extern) (export "g-const-funcnull" (global 0)) (export "g-const-func" (global 1)) diff --git a/tests/snapshots/testsuite/proposals/gc/linking.wast/33.print b/tests/snapshots/testsuite/proposals/gc/linking.wast/33.print index 710e143cac..00ed92260c 100644 --- a/tests/snapshots/testsuite/proposals/gc/linking.wast/33.print +++ b/tests/snapshots/testsuite/proposals/gc/linking.wast/33.print @@ -6,13 +6,13 @@ (import "Mref_ex" "g-const-ref" (global (;3;) funcref)) (import "Mref_ex" "g-const-func" (global (;4;) (ref func))) (import "Mref_ex" "g-const-ref" (global (;5;) (ref func))) - (import "Mref_ex" "g-const-refnull" (global (;6;) (ref null 0))) - (import "Mref_ex" "g-const-ref" (global (;7;) (ref null 0))) - (import "Mref_ex" "g-const-ref" (global (;8;) (ref 0))) + (import "Mref_ex" "g-const-refnull" (global (;6;) (ref null $t))) + (import "Mref_ex" "g-const-ref" (global (;7;) (ref null $t))) + (import "Mref_ex" "g-const-ref" (global (;8;) (ref $t))) (import "Mref_ex" "g-const-extern" (global (;9;) externref)) (import "Mref_ex" "g-var-funcnull" (global (;10;) (mut funcref))) (import "Mref_ex" "g-var-func" (global (;11;) (mut (ref func)))) - (import "Mref_ex" "g-var-refnull" (global (;12;) (mut (ref null 0)))) - (import "Mref_ex" "g-var-ref" (global (;13;) (mut (ref 0)))) + (import "Mref_ex" "g-var-refnull" (global (;12;) (mut (ref null $t)))) + (import "Mref_ex" "g-var-ref" (global (;13;) (mut (ref $t)))) (import "Mref_ex" "g-var-extern" (global (;14;) (mut externref))) ) diff --git a/tests/snapshots/testsuite/proposals/gc/ref.wast/0.print b/tests/snapshots/testsuite/proposals/gc/ref.wast/0.print index 826cb09e3e..08f98a4551 100644 --- a/tests/snapshots/testsuite/proposals/gc/ref.wast/0.print +++ b/tests/snapshots/testsuite/proposals/gc/ref.wast/0.print @@ -1,5 +1,5 @@ (module (type $t (;0;) (func)) - (type (;1;) (func (param funcref externref (ref func) (ref extern) (ref 0) (ref 0) (ref 0) (ref 0) funcref externref (ref null 0) (ref null 0)))) - (func (;0;) (type 1) (param funcref externref (ref func) (ref extern) (ref 0) (ref 0) (ref 0) (ref 0) funcref externref (ref null 0) (ref null 0))) + (type (;1;) (func (param funcref externref (ref func) (ref extern) (ref $t) (ref $t) (ref $t) (ref $t) funcref externref (ref null $t) (ref null $t)))) + (func (;0;) (type 1) (param funcref externref (ref func) (ref extern) (ref $t) (ref $t) (ref $t) (ref $t) funcref externref (ref null $t) (ref null $t))) ) diff --git a/tests/snapshots/testsuite/proposals/gc/ref_as_non_null.wast/0.print b/tests/snapshots/testsuite/proposals/gc/ref_as_non_null.wast/0.print index e874215a89..d4861f7951 100644 --- a/tests/snapshots/testsuite/proposals/gc/ref_as_non_null.wast/0.print +++ b/tests/snapshots/testsuite/proposals/gc/ref_as_non_null.wast/0.print @@ -1,13 +1,13 @@ (module (type $t (;0;) (func (result i32))) - (type (;1;) (func (param (ref 0)) (result i32))) - (type (;2;) (func (param (ref null 0)) (result i32))) - (func $nn (;0;) (type 1) (param $r (ref 0)) (result i32) + (type (;1;) (func (param (ref $t)) (result i32))) + (type (;2;) (func (param (ref null $t)) (result i32))) + (func $nn (;0;) (type 1) (param $r (ref $t)) (result i32) local.get $r ref.as_non_null call_ref $t ) - (func $n (;1;) (type 2) (param $r (ref null 0)) (result i32) + (func $n (;1;) (type 2) (param $r (ref null $t)) (result i32) local.get $r ref.as_non_null call_ref $t @@ -16,7 +16,7 @@ i32.const 7 ) (func (;3;) (type $t) (result i32) - ref.null 0 + ref.null $t call $n ) (func (;4;) (type $t) (result i32) diff --git a/tests/snapshots/testsuite/proposals/gc/ref_as_non_null.wast/6.print b/tests/snapshots/testsuite/proposals/gc/ref_as_non_null.wast/6.print index c2f8267b27..43c84a2099 100644 --- a/tests/snapshots/testsuite/proposals/gc/ref_as_non_null.wast/6.print +++ b/tests/snapshots/testsuite/proposals/gc/ref_as_non_null.wast/6.print @@ -1,9 +1,9 @@ (module (type $t (;0;) (func)) - (type (;1;) (func (param (ref 0)))) + (type (;1;) (func (param (ref $t)))) (type (;2;) (func (param (ref func)))) (type (;3;) (func (param (ref extern)))) - (func (;0;) (type 1) (param $r (ref 0)) + (func (;0;) (type 1) (param $r (ref $t)) local.get $r ref.as_non_null drop diff --git a/tests/snapshots/testsuite/proposals/gc/ref_cast.wast/42.print b/tests/snapshots/testsuite/proposals/gc/ref_cast.wast/42.print index 7608b5eab2..29b16b582b 100644 --- a/tests/snapshots/testsuite/proposals/gc/ref_cast.wast/42.print +++ b/tests/snapshots/testsuite/proposals/gc/ref_cast.wast/42.print @@ -37,155 +37,155 @@ (func (;1;) (type 8) call $init ref.null struct - ref.cast (ref null 0) + ref.cast (ref null $t0) drop i32.const 0 table.get 0 - ref.cast (ref null 0) + ref.cast (ref null $t0) drop i32.const 1 table.get 0 - ref.cast (ref null 0) + ref.cast (ref null $t0) drop i32.const 2 table.get 0 - ref.cast (ref null 0) + ref.cast (ref null $t0) drop i32.const 3 table.get 0 - ref.cast (ref null 0) + ref.cast (ref null $t0) drop i32.const 4 table.get 0 - ref.cast (ref null 0) + ref.cast (ref null $t0) drop ref.null struct - ref.cast (ref null 0) + ref.cast (ref null $t0) drop i32.const 1 table.get 0 - ref.cast (ref null 1) + ref.cast (ref null $t1) drop i32.const 2 table.get 0 - ref.cast (ref null 1) + ref.cast (ref null $t1) drop ref.null struct - ref.cast (ref null 0) + ref.cast (ref null $t0) drop i32.const 2 table.get 0 - ref.cast (ref null 3) + ref.cast (ref null $t2) drop ref.null struct - ref.cast (ref null 0) + ref.cast (ref null $t0) drop i32.const 3 table.get 0 - ref.cast (ref null 5) + ref.cast (ref null $t3) drop i32.const 4 table.get 0 - ref.cast (ref null 7) + ref.cast (ref null $t4) drop i32.const 0 table.get 0 - ref.cast (ref 0) + ref.cast (ref $t0) drop i32.const 1 table.get 0 - ref.cast (ref 0) + ref.cast (ref $t0) drop i32.const 2 table.get 0 - ref.cast (ref 0) + ref.cast (ref $t0) drop i32.const 3 table.get 0 - ref.cast (ref 0) + ref.cast (ref $t0) drop i32.const 4 table.get 0 - ref.cast (ref 0) + ref.cast (ref $t0) drop i32.const 1 table.get 0 - ref.cast (ref 1) + ref.cast (ref $t1) drop i32.const 2 table.get 0 - ref.cast (ref 1) + ref.cast (ref $t1) drop i32.const 2 table.get 0 - ref.cast (ref 3) + ref.cast (ref $t2) drop i32.const 3 table.get 0 - ref.cast (ref 5) + ref.cast (ref $t3) drop i32.const 4 table.get 0 - ref.cast (ref 7) + ref.cast (ref $t4) drop ) (func (;2;) (type 8) call $init i32.const 0 table.get 0 - ref.cast (ref 0) + ref.cast (ref $t0) drop i32.const 1 table.get 0 - ref.cast (ref 0) + ref.cast (ref $t0) drop i32.const 2 table.get 0 - ref.cast (ref 0) + ref.cast (ref $t0) drop i32.const 3 table.get 0 - ref.cast (ref 0) + ref.cast (ref $t0) drop i32.const 4 table.get 0 - ref.cast (ref 0) + ref.cast (ref $t0) drop i32.const 10 table.get 0 - ref.cast (ref 0) + ref.cast (ref $t0) drop i32.const 11 table.get 0 - ref.cast (ref 0) + ref.cast (ref $t0) drop i32.const 12 table.get 0 - ref.cast (ref 0) + ref.cast (ref $t0) drop i32.const 1 table.get 0 - ref.cast (ref 2) + ref.cast (ref $t1') drop i32.const 2 table.get 0 - ref.cast (ref 2) + ref.cast (ref $t1') drop i32.const 11 table.get 0 - ref.cast (ref 1) + ref.cast (ref $t1) drop i32.const 12 table.get 0 - ref.cast (ref 1) + ref.cast (ref $t1) drop i32.const 2 table.get 0 - ref.cast (ref 4) + ref.cast (ref $t2') drop i32.const 12 table.get 0 - ref.cast (ref 3) + ref.cast (ref $t2) drop ) (table (;0;) 20 structref) diff --git a/tests/snapshots/testsuite/proposals/gc/ref_is_null.wast/0.print b/tests/snapshots/testsuite/proposals/gc/ref_is_null.wast/0.print index f1d39bf1be..f354ae718f 100644 --- a/tests/snapshots/testsuite/proposals/gc/ref_is_null.wast/0.print +++ b/tests/snapshots/testsuite/proposals/gc/ref_is_null.wast/0.print @@ -2,7 +2,7 @@ (type $t (;0;) (func)) (type (;1;) (func (param funcref) (result i32))) (type (;2;) (func (param externref) (result i32))) - (type (;3;) (func (param (ref null 0)) (result i32))) + (type (;3;) (func (param (ref null $t)) (result i32))) (type (;4;) (func (result i32))) (type (;5;) (func (param externref))) (type (;6;) (func (param i32) (result i32))) @@ -15,12 +15,12 @@ local.get $x ref.is_null ) - (func $f3 (;3;) (type 3) (param $x (ref null 0)) (result i32) + (func $f3 (;3;) (type 3) (param $x (ref null $t)) (result i32) local.get $x ref.is_null ) (func $f3' (;4;) (type 4) (result i32) - ref.null 0 + ref.null $t call $f3 ) (func (;5;) (type 5) (param $r externref) @@ -36,7 +36,7 @@ ref.null extern table.set $t2 i32.const 1 - ref.null 0 + ref.null $t table.set $t3 ) (func (;7;) (type 6) (param $x i32) (result i32) @@ -56,7 +56,7 @@ ) (table $t1 (;0;) 2 funcref) (table $t2 (;1;) 2 externref) - (table $t3 (;2;) 2 (ref null 0)) + (table $t3 (;2;) 2 (ref null $t)) (export "funcref" (func $f1)) (export "externref" (func $f2)) (export "ref-null" (func $f3')) @@ -66,5 +66,5 @@ (export "externref-elem" (func 8)) (export "ref-elem" (func 9)) (elem (;0;) (i32.const 1) func $dummy) - (elem (;1;) (table $t3) (i32.const 1) (ref 0) (ref.func $dummy)) + (elem (;1;) (table $t3) (i32.const 1) (ref $t) (ref.func $dummy)) ) diff --git a/tests/snapshots/testsuite/proposals/gc/ref_is_null.wast/19.print b/tests/snapshots/testsuite/proposals/gc/ref_is_null.wast/19.print index b52ec60922..130a8a6860 100644 --- a/tests/snapshots/testsuite/proposals/gc/ref_is_null.wast/19.print +++ b/tests/snapshots/testsuite/proposals/gc/ref_is_null.wast/19.print @@ -1,9 +1,9 @@ (module (type $t (;0;) (func)) - (type (;1;) (func (param (ref 0)))) + (type (;1;) (func (param (ref $t)))) (type (;2;) (func (param (ref func)))) (type (;3;) (func (param (ref extern)))) - (func (;0;) (type 1) (param $r (ref 0)) + (func (;0;) (type 1) (param $r (ref $t)) local.get $r ref.is_null drop diff --git a/tests/snapshots/testsuite/proposals/gc/ref_null.wast/0.print b/tests/snapshots/testsuite/proposals/gc/ref_null.wast/0.print index 80311783b4..f167669fba 100644 --- a/tests/snapshots/testsuite/proposals/gc/ref_null.wast/0.print +++ b/tests/snapshots/testsuite/proposals/gc/ref_null.wast/0.print @@ -2,19 +2,19 @@ (type $t (;0;) (func)) (type (;1;) (func (result anyref))) (type (;2;) (func (result funcref))) - (type (;3;) (func (result (ref null 0)))) + (type (;3;) (func (result (ref null $t)))) (func (;0;) (type 1) (result anyref) ref.null any ) (func (;1;) (type 2) (result funcref) ref.null func ) - (func (;2;) (type 3) (result (ref null 0)) - ref.null 0 + (func (;2;) (type 3) (result (ref null $t)) + ref.null $t ) (global (;0;) anyref ref.null any) (global (;1;) funcref ref.null func) - (global (;2;) (ref null 0) ref.null 0) + (global (;2;) (ref null $t) ref.null $t) (export "anyref" (func 0)) (export "funcref" (func 1)) (export "ref" (func 2)) diff --git a/tests/snapshots/testsuite/proposals/gc/ref_null.wast/4.print b/tests/snapshots/testsuite/proposals/gc/ref_null.wast/4.print index c2860af2ef..347e7b4b7b 100644 --- a/tests/snapshots/testsuite/proposals/gc/ref_null.wast/4.print +++ b/tests/snapshots/testsuite/proposals/gc/ref_null.wast/4.print @@ -6,7 +6,7 @@ (type (;4;) (func (result nullfuncref))) (type (;5;) (func (result externref))) (type (;6;) (func (result nullexternref))) - (type (;7;) (func (result (ref null 0)))) + (type (;7;) (func (result (ref null $t)))) (func (;0;) (type 1) (result anyref) global.get $null ) @@ -25,7 +25,7 @@ (func (;5;) (type 6) (result nullexternref) global.get $nullextern ) - (func (;6;) (type 7) (result (ref null 0)) + (func (;6;) (type 7) (result (ref null $t)) global.get $nullfunc ) (global $null (;0;) nullref ref.null none) @@ -40,8 +40,8 @@ (global (;9;) nullref ref.null none) (global (;10;) nullfuncref ref.null nofunc) (global (;11;) nullexternref ref.null noextern) - (global (;12;) (ref null 0) ref.null 0) - (global (;13;) (ref null 0) ref.null nofunc) + (global (;12;) (ref null $t) ref.null $t) + (global (;13;) (ref null $t) ref.null nofunc) (export "anyref" (func 0)) (export "nullref" (func 1)) (export "funcref" (func 2)) diff --git a/tests/snapshots/testsuite/proposals/gc/ref_test.wast/68.print b/tests/snapshots/testsuite/proposals/gc/ref_test.wast/68.print index d0250ee8ec..d291d00426 100644 --- a/tests/snapshots/testsuite/proposals/gc/ref_test.wast/68.print +++ b/tests/snapshots/testsuite/proposals/gc/ref_test.wast/68.print @@ -38,299 +38,299 @@ call $init block $l ref.null struct - ref.test (ref null 0) + ref.test (ref null $t0) i32.eqz br_if $l - ref.null 0 - ref.test (ref null 0) + ref.null $t0 + ref.test (ref null $t0) i32.eqz br_if $l - ref.null 1 - ref.test (ref null 0) + ref.null $t1 + ref.test (ref null $t0) i32.eqz br_if $l - ref.null 3 - ref.test (ref null 0) + ref.null $t2 + ref.test (ref null $t0) i32.eqz br_if $l - ref.null 5 - ref.test (ref null 0) + ref.null $t3 + ref.test (ref null $t0) i32.eqz br_if $l - ref.null 7 - ref.test (ref null 0) + ref.null $t4 + ref.test (ref null $t0) i32.eqz br_if $l i32.const 0 table.get 0 - ref.test (ref null 0) + ref.test (ref null $t0) i32.eqz br_if $l i32.const 1 table.get 0 - ref.test (ref null 0) + ref.test (ref null $t0) i32.eqz br_if $l i32.const 2 table.get 0 - ref.test (ref null 0) + ref.test (ref null $t0) i32.eqz br_if $l i32.const 3 table.get 0 - ref.test (ref null 0) + ref.test (ref null $t0) i32.eqz br_if $l i32.const 4 table.get 0 - ref.test (ref null 0) + ref.test (ref null $t0) i32.eqz br_if $l ref.null struct - ref.test (ref null 1) + ref.test (ref null $t1) i32.eqz br_if $l - ref.null 0 - ref.test (ref null 1) + ref.null $t0 + ref.test (ref null $t1) i32.eqz br_if $l - ref.null 1 - ref.test (ref null 1) + ref.null $t1 + ref.test (ref null $t1) i32.eqz br_if $l - ref.null 3 - ref.test (ref null 1) + ref.null $t2 + ref.test (ref null $t1) i32.eqz br_if $l - ref.null 5 - ref.test (ref null 1) + ref.null $t3 + ref.test (ref null $t1) i32.eqz br_if $l - ref.null 7 - ref.test (ref null 1) + ref.null $t4 + ref.test (ref null $t1) i32.eqz br_if $l i32.const 1 table.get 0 - ref.test (ref null 1) + ref.test (ref null $t1) i32.eqz br_if $l i32.const 2 table.get 0 - ref.test (ref null 1) + ref.test (ref null $t1) i32.eqz br_if $l ref.null struct - ref.test (ref null 3) + ref.test (ref null $t2) i32.eqz br_if $l - ref.null 0 - ref.test (ref null 3) + ref.null $t0 + ref.test (ref null $t2) i32.eqz br_if $l - ref.null 1 - ref.test (ref null 3) + ref.null $t1 + ref.test (ref null $t2) i32.eqz br_if $l - ref.null 3 - ref.test (ref null 3) + ref.null $t2 + ref.test (ref null $t2) i32.eqz br_if $l - ref.null 5 - ref.test (ref null 3) + ref.null $t3 + ref.test (ref null $t2) i32.eqz br_if $l - ref.null 7 - ref.test (ref null 3) + ref.null $t4 + ref.test (ref null $t2) i32.eqz br_if $l i32.const 2 table.get 0 - ref.test (ref null 3) + ref.test (ref null $t2) i32.eqz br_if $l ref.null struct - ref.test (ref null 5) + ref.test (ref null $t3) i32.eqz br_if $l - ref.null 0 - ref.test (ref null 5) + ref.null $t0 + ref.test (ref null $t3) i32.eqz br_if $l - ref.null 1 - ref.test (ref null 5) + ref.null $t1 + ref.test (ref null $t3) i32.eqz br_if $l - ref.null 3 - ref.test (ref null 5) + ref.null $t2 + ref.test (ref null $t3) i32.eqz br_if $l - ref.null 5 - ref.test (ref null 5) + ref.null $t3 + ref.test (ref null $t3) i32.eqz br_if $l - ref.null 7 - ref.test (ref null 5) + ref.null $t4 + ref.test (ref null $t3) i32.eqz br_if $l i32.const 3 table.get 0 - ref.test (ref null 5) + ref.test (ref null $t3) i32.eqz br_if $l ref.null struct - ref.test (ref null 7) + ref.test (ref null $t4) i32.eqz br_if $l - ref.null 0 - ref.test (ref null 7) + ref.null $t0 + ref.test (ref null $t4) i32.eqz br_if $l - ref.null 1 - ref.test (ref null 7) + ref.null $t1 + ref.test (ref null $t4) i32.eqz br_if $l - ref.null 3 - ref.test (ref null 7) + ref.null $t2 + ref.test (ref null $t4) i32.eqz br_if $l - ref.null 5 - ref.test (ref null 7) + ref.null $t3 + ref.test (ref null $t4) i32.eqz br_if $l - ref.null 7 - ref.test (ref null 7) + ref.null $t4 + ref.test (ref null $t4) i32.eqz br_if $l i32.const 4 table.get 0 - ref.test (ref null 7) + ref.test (ref null $t4) i32.eqz br_if $l i32.const 0 table.get 0 - ref.test (ref 0) + ref.test (ref $t0) i32.eqz br_if $l i32.const 1 table.get 0 - ref.test (ref 0) + ref.test (ref $t0) i32.eqz br_if $l i32.const 2 table.get 0 - ref.test (ref 0) + ref.test (ref $t0) i32.eqz br_if $l i32.const 3 table.get 0 - ref.test (ref 0) + ref.test (ref $t0) i32.eqz br_if $l i32.const 4 table.get 0 - ref.test (ref 0) + ref.test (ref $t0) i32.eqz br_if $l i32.const 1 table.get 0 - ref.test (ref 1) + ref.test (ref $t1) i32.eqz br_if $l i32.const 2 table.get 0 - ref.test (ref 1) + ref.test (ref $t1) i32.eqz br_if $l i32.const 2 table.get 0 - ref.test (ref 3) + ref.test (ref $t2) i32.eqz br_if $l i32.const 3 table.get 0 - ref.test (ref 5) + ref.test (ref $t3) i32.eqz br_if $l i32.const 4 table.get 0 - ref.test (ref 7) + ref.test (ref $t4) i32.eqz br_if $l ref.null struct - ref.test (ref 0) + ref.test (ref $t0) br_if $l ref.null struct - ref.test (ref 1) + ref.test (ref $t1) br_if $l ref.null struct - ref.test (ref 3) + ref.test (ref $t2) br_if $l ref.null struct - ref.test (ref 5) + ref.test (ref $t3) br_if $l ref.null struct - ref.test (ref 7) + ref.test (ref $t4) br_if $l i32.const 0 table.get 0 - ref.test (ref 1) + ref.test (ref $t1) br_if $l i32.const 3 table.get 0 - ref.test (ref 1) + ref.test (ref $t1) br_if $l i32.const 4 table.get 0 - ref.test (ref 1) + ref.test (ref $t1) br_if $l i32.const 0 table.get 0 - ref.test (ref 3) + ref.test (ref $t2) br_if $l i32.const 1 table.get 0 - ref.test (ref 3) + ref.test (ref $t2) br_if $l i32.const 3 table.get 0 - ref.test (ref 3) + ref.test (ref $t2) br_if $l i32.const 4 table.get 0 - ref.test (ref 3) + ref.test (ref $t2) br_if $l i32.const 0 table.get 0 - ref.test (ref 5) + ref.test (ref $t3) br_if $l i32.const 1 table.get 0 - ref.test (ref 5) + ref.test (ref $t3) br_if $l i32.const 2 table.get 0 - ref.test (ref 5) + ref.test (ref $t3) br_if $l i32.const 4 table.get 0 - ref.test (ref 5) + ref.test (ref $t3) br_if $l i32.const 0 table.get 0 - ref.test (ref 7) + ref.test (ref $t4) br_if $l i32.const 1 table.get 0 - ref.test (ref 7) + ref.test (ref $t4) br_if $l i32.const 2 table.get 0 - ref.test (ref 7) + ref.test (ref $t4) br_if $l i32.const 3 table.get 0 - ref.test (ref 7) + ref.test (ref $t4) br_if $l return end @@ -341,72 +341,72 @@ block $l i32.const 0 table.get 0 - ref.test (ref 0) + ref.test (ref $t0) i32.eqz br_if $l i32.const 1 table.get 0 - ref.test (ref 0) + ref.test (ref $t0) i32.eqz br_if $l i32.const 2 table.get 0 - ref.test (ref 0) + ref.test (ref $t0) i32.eqz br_if $l i32.const 3 table.get 0 - ref.test (ref 0) + ref.test (ref $t0) i32.eqz br_if $l i32.const 4 table.get 0 - ref.test (ref 0) + ref.test (ref $t0) i32.eqz br_if $l i32.const 10 table.get 0 - ref.test (ref 0) + ref.test (ref $t0) i32.eqz br_if $l i32.const 11 table.get 0 - ref.test (ref 0) + ref.test (ref $t0) i32.eqz br_if $l i32.const 12 table.get 0 - ref.test (ref 0) + ref.test (ref $t0) i32.eqz br_if $l i32.const 1 table.get 0 - ref.test (ref 2) + ref.test (ref $t1') i32.eqz br_if $l i32.const 2 table.get 0 - ref.test (ref 2) + ref.test (ref $t1') i32.eqz br_if $l i32.const 11 table.get 0 - ref.test (ref 1) + ref.test (ref $t1) i32.eqz br_if $l i32.const 12 table.get 0 - ref.test (ref 1) + ref.test (ref $t1) i32.eqz br_if $l i32.const 2 table.get 0 - ref.test (ref 4) + ref.test (ref $t2') i32.eqz br_if $l i32.const 12 table.get 0 - ref.test (ref 3) + ref.test (ref $t2) i32.eqz br_if $l return diff --git a/tests/snapshots/testsuite/proposals/gc/return_call_ref.wast/0.print b/tests/snapshots/testsuite/proposals/gc/return_call_ref.wast/0.print index 2e35173950..451693d9de 100644 --- a/tests/snapshots/testsuite/proposals/gc/return_call_ref.wast/0.print +++ b/tests/snapshots/testsuite/proposals/gc/return_call_ref.wast/0.print @@ -110,7 +110,7 @@ return_call_ref $i64-f64 ) (func (;24;) (type $proc) - ref.null 0 + ref.null $proc return_call_ref $proc ) (func $fac-acc (;25;) (type $i64i64-i64) (param i64 i64) (result i64) @@ -168,22 +168,22 @@ return_call_ref $i64-i64 end ) - (global $const-i32 (;0;) (ref 1) ref.func $const-i32) - (global $const-i64 (;1;) (ref 2) ref.func $const-i64) - (global $const-f32 (;2;) (ref 3) ref.func $const-f32) - (global $const-f64 (;3;) (ref 4) ref.func $const-f64) - (global $id-i32 (;4;) (ref 5) ref.func $id-i32) - (global $id-i64 (;5;) (ref 6) ref.func $id-i64) - (global $id-f32 (;6;) (ref 7) ref.func $id-f32) - (global $id-f64 (;7;) (ref 8) ref.func $id-f64) - (global $f32-i32 (;8;) (ref 9) ref.func $f32-i32) - (global $i32-i64 (;9;) (ref 10) ref.func $i32-i64) - (global $f64-f32 (;10;) (ref 11) ref.func $f64-f32) - (global $i64-f64 (;11;) (ref 12) ref.func $i64-f64) - (global $fac-acc (;12;) (ref 13) ref.func $fac-acc) - (global $count (;13;) (ref 6) ref.func $count) - (global $even (;14;) (ref 6) ref.func $even) - (global $odd (;15;) (ref 6) ref.func $odd) + (global $const-i32 (;0;) (ref $-i32) ref.func $const-i32) + (global $const-i64 (;1;) (ref $-i64) ref.func $const-i64) + (global $const-f32 (;2;) (ref $-f32) ref.func $const-f32) + (global $const-f64 (;3;) (ref $-f64) ref.func $const-f64) + (global $id-i32 (;4;) (ref $i32-i32) ref.func $id-i32) + (global $id-i64 (;5;) (ref $i64-i64) ref.func $id-i64) + (global $id-f32 (;6;) (ref $f32-f32) ref.func $id-f32) + (global $id-f64 (;7;) (ref $f64-f64) ref.func $id-f64) + (global $f32-i32 (;8;) (ref $f32-i32) ref.func $f32-i32) + (global $i32-i64 (;9;) (ref $i32-i64) ref.func $i32-i64) + (global $f64-f32 (;10;) (ref $f64-f32) ref.func $f64-f32) + (global $i64-f64 (;11;) (ref $i64-f64) ref.func $i64-f64) + (global $fac-acc (;12;) (ref $i64i64-i64) ref.func $fac-acc) + (global $count (;13;) (ref $i64-i64) ref.func $count) + (global $even (;14;) (ref $i64-i64) ref.func $even) + (global $odd (;15;) (ref $i64-i64) ref.func $odd) (export "type-i32" (func 12)) (export "type-i64" (func 13)) (export "type-f32" (func 14)) diff --git a/tests/snapshots/testsuite/proposals/gc/return_call_ref.wast/33.print b/tests/snapshots/testsuite/proposals/gc/return_call_ref.wast/33.print index 086c98c8b5..11dc25a989 100644 --- a/tests/snapshots/testsuite/proposals/gc/return_call_ref.wast/33.print +++ b/tests/snapshots/testsuite/proposals/gc/return_call_ref.wast/33.print @@ -1,18 +1,18 @@ (module (type $t (;0;) (func)) - (type $t1 (;1;) (func (result (ref 0)))) - (type $t2 (;2;) (func (result (ref null 0)))) + (type $t1 (;1;) (func (result (ref $t)))) + (type $t2 (;2;) (func (result (ref null $t)))) (type $t3 (;3;) (func (result (ref func)))) (type $t4 (;4;) (func (result funcref))) - (func $f11 (;0;) (type $t1) (result (ref 0)) + (func $f11 (;0;) (type $t1) (result (ref $t)) ref.func $f11 return_call_ref $t1 ) - (func $f21 (;1;) (type $t2) (result (ref null 0)) + (func $f21 (;1;) (type $t2) (result (ref null $t)) ref.func $f11 return_call_ref $t1 ) - (func $f22 (;2;) (type $t2) (result (ref null 0)) + (func $f22 (;2;) (type $t2) (result (ref null $t)) ref.func $f22 return_call_ref $t2 ) diff --git a/tests/snapshots/testsuite/proposals/gc/struct.wast/16.print b/tests/snapshots/testsuite/proposals/gc/struct.wast/16.print index d3f5fbdae6..83697b5886 100644 --- a/tests/snapshots/testsuite/proposals/gc/struct.wast/16.print +++ b/tests/snapshots/testsuite/proposals/gc/struct.wast/16.print @@ -2,13 +2,13 @@ (type $t (;0;) (struct (field i32) (field (mut i32)))) (type (;1;) (func)) (func (;0;) (type 1) - (local (ref null 0)) + (local (ref null $t)) local.get 0 struct.get $t 1 drop ) (func (;1;) (type 1) - (local (ref null 0)) + (local (ref null $t)) local.get 0 i32.const 0 struct.set $t 1 diff --git a/tests/snapshots/testsuite/proposals/gc/struct.wast/19.print b/tests/snapshots/testsuite/proposals/gc/struct.wast/19.print index db372cd2da..590c2cbc62 100644 --- a/tests/snapshots/testsuite/proposals/gc/struct.wast/19.print +++ b/tests/snapshots/testsuite/proposals/gc/struct.wast/19.print @@ -68,8 +68,8 @@ global.get 0 struct.get_u $s 3 ) - (global (;0;) (ref 0) i32.const 0 i32.const 1 i32.const 2 i32.const 3 struct.new $s) - (global (;1;) (ref 0) i32.const 254 i32.const 255 i32.const 65534 i32.const 65535 struct.new $s) + (global (;0;) (ref $s) i32.const 0 i32.const 1 i32.const 2 i32.const 3 struct.new $s) + (global (;1;) (ref $s) i32.const 254 i32.const 255 i32.const 65534 i32.const 65535 struct.new $s) (export "g0" (global 0)) (export "g1" (global 1)) (export "get_packed_g0_0" (func 0)) diff --git a/tests/snapshots/testsuite/proposals/gc/struct.wast/2.print b/tests/snapshots/testsuite/proposals/gc/struct.wast/2.print index 5e729f23f3..1c6dffdf31 100644 --- a/tests/snapshots/testsuite/proposals/gc/struct.wast/2.print +++ b/tests/snapshots/testsuite/proposals/gc/struct.wast/2.print @@ -1,9 +1,9 @@ (module (rec - (type $s0 (;0;) (struct (field (ref 0)) (field (ref 1)) (field (ref 0)) (field (ref 1)))) - (type $s1 (;1;) (struct (field (ref 0)) (field (ref 1)) (field (ref 0)) (field (ref 1)))) + (type $s0 (;0;) (struct (field (ref $s0)) (field (ref $s1)) (field (ref $s0)) (field (ref $s1)))) + (type $s1 (;1;) (struct (field (ref $s0)) (field (ref $s1)) (field (ref $s0)) (field (ref $s1)))) ) (type $forward (;2;) (struct)) - (type (;3;) (func (param (ref 2)))) - (func (;0;) (type 3) (param (ref 2))) + (type (;3;) (func (param (ref $forward)))) + (func (;0;) (type 3) (param (ref $forward))) ) diff --git a/tests/snapshots/testsuite/proposals/gc/struct.wast/5.print b/tests/snapshots/testsuite/proposals/gc/struct.wast/5.print index f63d5dd79d..4ba020cd0a 100644 --- a/tests/snapshots/testsuite/proposals/gc/struct.wast/5.print +++ b/tests/snapshots/testsuite/proposals/gc/struct.wast/5.print @@ -3,17 +3,17 @@ (type $t1 (;1;) (struct (field i32) (field f32))) (type $t2 (;2;) (struct (field i32) (field i32) (field i64))) (type (;3;) (func (param (ref 0)) (result i32))) - (type (;4;) (func (param (ref 1)) (result f32))) - (type (;5;) (func (param (ref 2)) (result i64))) + (type (;4;) (func (param (ref $t1)) (result f32))) + (type (;5;) (func (param (ref $t2)) (result i64))) (func (;0;) (type 3) (param (ref 0)) (result i32) local.get 0 struct.get 0 0 ) - (func (;1;) (type 4) (param (ref 1)) (result f32) + (func (;1;) (type 4) (param (ref $t1)) (result f32) local.get 0 struct.get $t1 1 ) - (func (;2;) (type 5) (param (ref 2)) (result i64) + (func (;2;) (type 5) (param (ref $t2)) (result i64) local.get 0 struct.get $t2 2 ) diff --git a/tests/snapshots/testsuite/proposals/gc/struct.wast/7.print b/tests/snapshots/testsuite/proposals/gc/struct.wast/7.print index 060be4cdb3..51e4cbbbdb 100644 --- a/tests/snapshots/testsuite/proposals/gc/struct.wast/7.print +++ b/tests/snapshots/testsuite/proposals/gc/struct.wast/7.print @@ -1,14 +1,14 @@ (module (type $vec (;0;) (struct (field f32) (field (mut f32)) (field f32))) (type (;1;) (func (result anyref))) - (type (;2;) (func (param (ref 0)) (result f32))) + (type (;2;) (func (param (ref $vec)) (result f32))) (type (;3;) (func (result f32))) - (type (;4;) (func (param (ref 0) f32) (result f32))) + (type (;4;) (func (param (ref $vec) f32) (result f32))) (type (;5;) (func (param f32) (result f32))) (func (;0;) (type 1) (result anyref) struct.new_default $vec ) - (func $get_0_0 (;1;) (type 2) (param $v (ref 0)) (result f32) + (func $get_0_0 (;1;) (type 2) (param $v (ref $vec)) (result f32) local.get $v struct.get $vec 0 ) @@ -16,7 +16,7 @@ struct.new_default $vec call $get_0_0 ) - (func $get_vec_0 (;3;) (type 2) (param $v (ref 0)) (result f32) + (func $get_vec_0 (;3;) (type 2) (param $v (ref $vec)) (result f32) local.get $v struct.get $vec 0 ) @@ -24,7 +24,7 @@ struct.new_default $vec call $get_vec_0 ) - (func $get_0_y (;5;) (type 2) (param $v (ref 0)) (result f32) + (func $get_0_y (;5;) (type 2) (param $v (ref $vec)) (result f32) local.get $v struct.get $vec 1 ) @@ -32,7 +32,7 @@ struct.new_default $vec call $get_0_y ) - (func $get_vec_y (;7;) (type 2) (param $v (ref 0)) (result f32) + (func $get_vec_y (;7;) (type 2) (param $v (ref $vec)) (result f32) local.get $v struct.get $vec 1 ) @@ -40,7 +40,7 @@ struct.new_default $vec call $get_vec_y ) - (func $set_get_y (;9;) (type 4) (param $v (ref 0)) (param $y f32) (result f32) + (func $set_get_y (;9;) (type 4) (param $v (ref $vec)) (param $y f32) (result f32) local.get $v local.get $y struct.set $vec 1 @@ -52,7 +52,7 @@ local.get $y call $set_get_y ) - (func $set_get_1 (;11;) (type 4) (param $v (ref 0)) (param $y f32) (result f32) + (func $set_get_1 (;11;) (type 4) (param $v (ref $vec)) (param $y f32) (result f32) local.get $v local.get $y struct.set $vec 1 @@ -64,8 +64,8 @@ local.get $y call $set_get_1 ) - (global (;0;) (ref 0) f32.const 0x1p+0 (;=1;) f32.const 0x1p+1 (;=2;) f32.const 0x1.8p+1 (;=3;) struct.new $vec) - (global (;1;) (ref 0) struct.new_default $vec) + (global (;0;) (ref $vec) f32.const 0x1p+0 (;=1;) f32.const 0x1p+1 (;=2;) f32.const 0x1.8p+1 (;=3;) struct.new $vec) + (global (;1;) (ref $vec) struct.new_default $vec) (export "new" (func 0)) (export "get_0_0" (func 2)) (export "get_vec_0" (func 4)) diff --git a/tests/snapshots/testsuite/proposals/gc/table-sub.wast/0.print b/tests/snapshots/testsuite/proposals/gc/table-sub.wast/0.print index e5ffc41794..cc4f3a21c3 100644 --- a/tests/snapshots/testsuite/proposals/gc/table-sub.wast/0.print +++ b/tests/snapshots/testsuite/proposals/gc/table-sub.wast/0.print @@ -11,6 +11,6 @@ table.copy $t1 $t2 ) (table $t1 (;0;) 10 funcref) - (table $t2 (;1;) 10 (ref null 0)) + (table $t2 (;1;) 10 (ref null $t)) (elem $el (;0;) funcref) ) diff --git a/tests/snapshots/testsuite/proposals/gc/table.wast/29.print b/tests/snapshots/testsuite/proposals/gc/table.wast/29.print index cf9883fea8..3122c840d6 100644 --- a/tests/snapshots/testsuite/proposals/gc/table.wast/29.print +++ b/tests/snapshots/testsuite/proposals/gc/table.wast/29.print @@ -1,6 +1,6 @@ (module (type $f (;0;) (func)) (func $f (;0;) (type $f)) - (global (;0;) (ref 0) ref.func $f) + (global (;0;) (ref $f) ref.func $f) (export "g" (global 0)) ) diff --git a/tests/snapshots/testsuite/proposals/gc/table.wast/31.print b/tests/snapshots/testsuite/proposals/gc/table.wast/31.print index 03b073eb84..1639a3daa1 100644 --- a/tests/snapshots/testsuite/proposals/gc/table.wast/31.print +++ b/tests/snapshots/testsuite/proposals/gc/table.wast/31.print @@ -1,7 +1,7 @@ (module (type $dummy (;0;) (func)) (type (;1;) (func (result funcref))) - (import "M" "g" (global $g (;0;) (ref 0))) + (import "M" "g" (global $g (;0;) (ref $dummy))) (func $dummy (;0;) (type $dummy)) (func (;1;) (type 1) (result funcref) i32.const 1 @@ -25,9 +25,9 @@ ) (table $t1 (;0;) 10 funcref) (table $t2 (;1;) 10 funcref ref.func $dummy) - (table $t3 (;2;) 10 (ref 0) ref.func $dummy) + (table $t3 (;2;) 10 (ref $dummy) ref.func $dummy) (table $t4 (;3;) 10 funcref global.get $g) - (table $t5 (;4;) 10 (ref 0) global.get $g) + (table $t5 (;4;) 10 (ref $dummy) global.get $g) (export "get1" (func 1)) (export "get2" (func 2)) (export "get3" (func 3)) diff --git a/tests/snapshots/testsuite/proposals/gc/table.wast/9.print b/tests/snapshots/testsuite/proposals/gc/table.wast/9.print index 14198fb29f..7e017d6dd5 100644 --- a/tests/snapshots/testsuite/proposals/gc/table.wast/9.print +++ b/tests/snapshots/testsuite/proposals/gc/table.wast/9.print @@ -1,4 +1,4 @@ (module (type $t (;0;) (func)) - (table (;0;) 1 (ref null 0)) + (table (;0;) 1 (ref null $t)) ) diff --git a/tests/snapshots/testsuite/proposals/gc/type-canon.wast/0.print b/tests/snapshots/testsuite/proposals/gc/type-canon.wast/0.print index 4ad99d3418..47f8efc503 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-canon.wast/0.print +++ b/tests/snapshots/testsuite/proposals/gc/type-canon.wast/0.print @@ -1,7 +1,7 @@ (module (rec - (type $t1 (;0;) (func (param i32 (ref 2)))) - (type $t2 (;1;) (func (param i32 (ref 0)))) - (type $t3 (;2;) (func (param i32 (ref 1)))) + (type $t1 (;0;) (func (param i32 (ref $t3)))) + (type $t2 (;1;) (func (param i32 (ref $t1)))) + (type $t3 (;2;) (func (param i32 (ref $t2)))) ) ) diff --git a/tests/snapshots/testsuite/proposals/gc/type-canon.wast/1.print b/tests/snapshots/testsuite/proposals/gc/type-canon.wast/1.print index 55576c41c1..ef5043f454 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-canon.wast/1.print +++ b/tests/snapshots/testsuite/proposals/gc/type-canon.wast/1.print @@ -1,9 +1,9 @@ (module (rec - (type $t0 (;0;) (func (param i32 (ref 2) (ref 3)))) - (type $t1 (;1;) (func (param i32 (ref 0) i32 (ref 4)))) - (type $t2 (;2;) (func (param i32 (ref 2) (ref 1)))) - (type $t3 (;3;) (func (param i32 (ref 2) i32 (ref 4)))) - (type $t4 (;4;) (func (param (ref 0) (ref 2)))) + (type $t0 (;0;) (func (param i32 (ref $t2) (ref $t3)))) + (type $t1 (;1;) (func (param i32 (ref $t0) i32 (ref $t4)))) + (type $t2 (;2;) (func (param i32 (ref $t2) (ref $t1)))) + (type $t3 (;3;) (func (param i32 (ref $t2) i32 (ref $t4)))) + (type $t4 (;4;) (func (param (ref $t0) (ref $t2)))) ) ) diff --git a/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/0.print b/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/0.print index 363cd4f26c..d5c0f44628 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/0.print +++ b/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/0.print @@ -1,13 +1,13 @@ (module (type $t1 (;0;) (func (param f32 f32) (result f32))) (type $t2 (;1;) (func (param f32 f32) (result f32))) - (type (;2;) (func (param (ref 0)))) - (type (;3;) (func (param (ref 1)))) - (func $f1 (;0;) (type 2) (param $r (ref 0)) + (type (;2;) (func (param (ref $t1)))) + (type (;3;) (func (param (ref $t2)))) + (func $f1 (;0;) (type 2) (param $r (ref $t1)) local.get $r call $f2 ) - (func $f2 (;1;) (type 3) (param $r (ref 1)) + (func $f2 (;1;) (type 3) (param $r (ref $t2)) local.get $r call $f1 ) diff --git a/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/1.print b/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/1.print index c76660d600..1167493998 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/1.print +++ b/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/1.print @@ -1,16 +1,16 @@ (module (type $s0 (;0;) (func (param i32) (result f32))) - (type $s1 (;1;) (func (param i32 (ref 0)) (result (ref 0)))) - (type $s2 (;2;) (func (param i32 (ref 0)) (result (ref 0)))) - (type $t1 (;3;) (func (param (ref 1)) (result (ref 2)))) - (type $t2 (;4;) (func (param (ref 2)) (result (ref 1)))) - (type (;5;) (func (param (ref 3)))) - (type (;6;) (func (param (ref 4)))) - (func $f1 (;0;) (type 5) (param $r (ref 3)) + (type $s1 (;1;) (func (param i32 (ref $s0)) (result (ref $s0)))) + (type $s2 (;2;) (func (param i32 (ref $s0)) (result (ref $s0)))) + (type $t1 (;3;) (func (param (ref $s1)) (result (ref $s2)))) + (type $t2 (;4;) (func (param (ref $s2)) (result (ref $s1)))) + (type (;5;) (func (param (ref $t1)))) + (type (;6;) (func (param (ref $t2)))) + (func $f1 (;0;) (type 5) (param $r (ref $t1)) local.get $r call $f2 ) - (func $f2 (;1;) (type 6) (param $r (ref 4)) + (func $f2 (;1;) (type 6) (param $r (ref $t2)) local.get $r call $f1 ) diff --git a/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/10.print b/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/10.print index 59a12c66af..ad3b909753 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/10.print +++ b/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/10.print @@ -1,47 +1,47 @@ (module (rec - (type $t1 (;0;) (func (result (ref null 0)))) + (type $t1 (;0;) (func (result (ref null $t1)))) ) (rec - (type $t2 (;1;) (func (result (ref null 1)))) + (type $t2 (;1;) (func (result (ref null $t2)))) ) (type (;2;) (func)) - (func $f1 (;0;) (type $t1) (result (ref null 0)) - ref.null 0 + (func $f1 (;0;) (type $t1) (result (ref null $t1)) + ref.null $t1 ) - (func $f2 (;1;) (type $t2) (result (ref null 1)) - ref.null 1 + (func $f2 (;1;) (type $t2) (result (ref null $t2)) + ref.null $t2 ) (func (;2;) (type 2) - block (result (ref null 0)) ;; label = @1 + block (result (ref null $t1)) ;; label = @1 i32.const 0 call_indirect (type $t1) end - block (result (ref null 0)) ;; label = @1 + block (result (ref null $t1)) ;; label = @1 i32.const 0 call_indirect (type $t2) end - block (result (ref null 1)) ;; label = @1 + block (result (ref null $t2)) ;; label = @1 i32.const 0 call_indirect (type $t1) end - block (result (ref null 1)) ;; label = @1 + block (result (ref null $t2)) ;; label = @1 i32.const 0 call_indirect (type $t2) end - block (result (ref null 0)) ;; label = @1 + block (result (ref null $t1)) ;; label = @1 i32.const 1 call_indirect (type $t1) end - block (result (ref null 0)) ;; label = @1 + block (result (ref null $t1)) ;; label = @1 i32.const 1 call_indirect (type $t2) end - block (result (ref null 1)) ;; label = @1 + block (result (ref null $t2)) ;; label = @1 i32.const 1 call_indirect (type $t1) end - block (result (ref null 1)) ;; label = @1 + block (result (ref null $t2)) ;; label = @1 i32.const 1 call_indirect (type $t2) end diff --git a/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/12.print b/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/12.print index a0b1dadaeb..2b6d605e8e 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/12.print +++ b/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/12.print @@ -1,18 +1,18 @@ (module (rec - (type $t1 (;0;) (func (param i32 (ref 0)))) - (type $t2 (;1;) (func (param i32 (ref 2)))) - (type $t3 (;2;) (func (param i32 (ref 1)))) + (type $t1 (;0;) (func (param i32 (ref $t1)))) + (type $t2 (;1;) (func (param i32 (ref $t3)))) + (type $t3 (;2;) (func (param i32 (ref $t2)))) ) (rec - (type $u1 (;3;) (func (param i32 (ref 3)))) - (type $u2 (;4;) (func (param i32 (ref 5)))) - (type $u3 (;5;) (func (param i32 (ref 4)))) + (type $u1 (;3;) (func (param i32 (ref $u1)))) + (type $u2 (;4;) (func (param i32 (ref $u3)))) + (type $u3 (;5;) (func (param i32 (ref $u2)))) ) (type (;6;) (func)) - (func $f1 (;0;) (type $t1) (param i32 (ref 0))) - (func $f2 (;1;) (type $t2) (param i32 (ref 2))) - (func $f3 (;2;) (type $t3) (param i32 (ref 1))) + (func $f1 (;0;) (type $t1) (param i32 (ref $t1))) + (func $f2 (;1;) (type $t2) (param i32 (ref $t3))) + (func $f3 (;2;) (type $t3) (param i32 (ref $t2))) (func (;3;) (type 6) i32.const 1 ref.func $f1 diff --git a/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/14.print b/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/14.print index 4ecfdf1af0..f9f69387ba 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/14.print +++ b/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/14.print @@ -1,6 +1,6 @@ (module (type $t1 (;0;) (func (param f32 f32) (result f32))) - (type (;1;) (func (param (ref 0)))) - (func (;0;) (type 1) (param (ref 0))) + (type (;1;) (func (param (ref $t1)))) + (func (;0;) (type 1) (param (ref $t1))) (export "f" (func 0)) ) diff --git a/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/16.print b/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/16.print index d566b45e6d..063cc5834b 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/16.print +++ b/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/16.print @@ -1,5 +1,5 @@ (module (type $t2 (;0;) (func (param f32 f32) (result f32))) - (type (;1;) (func (param (ref 0)))) + (type (;1;) (func (param (ref $t2)))) (import "M" "f" (func (;0;) (type 1))) ) diff --git a/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/17.print b/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/17.print index aeef19eac6..66a9157ef6 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/17.print +++ b/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/17.print @@ -1,12 +1,12 @@ (module (type $s0 (;0;) (func (param i32) (result f32))) - (type $s1 (;1;) (func (param i32 (ref 0)) (result (ref 0)))) - (type $s2 (;2;) (func (param i32 (ref 0)) (result (ref 0)))) - (type $t1 (;3;) (func (param (ref 1)) (result (ref 2)))) - (type $t2 (;4;) (func (param (ref 2)) (result (ref 1)))) - (type (;5;) (func (param (ref 3)))) - (func (;0;) (type 5) (param (ref 3))) - (func (;1;) (type 5) (param (ref 3))) + (type $s1 (;1;) (func (param i32 (ref $s0)) (result (ref $s0)))) + (type $s2 (;2;) (func (param i32 (ref $s0)) (result (ref $s0)))) + (type $t1 (;3;) (func (param (ref $s1)) (result (ref $s2)))) + (type $t2 (;4;) (func (param (ref $s2)) (result (ref $s1)))) + (type (;5;) (func (param (ref $t1)))) + (func (;0;) (type 5) (param (ref $t1))) + (func (;1;) (type 5) (param (ref $t1))) (export "f1" (func 0)) (export "f2" (func 1)) ) diff --git a/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/19.print b/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/19.print index 49438f1fc3..28eac56387 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/19.print +++ b/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/19.print @@ -1,11 +1,11 @@ (module (type $s0 (;0;) (func (param i32) (result f32))) - (type $s1 (;1;) (func (param i32 (ref 0)) (result (ref 0)))) - (type $s2 (;2;) (func (param i32 (ref 0)) (result (ref 0)))) - (type $t1 (;3;) (func (param (ref 1)) (result (ref 2)))) - (type $t2 (;4;) (func (param (ref 2)) (result (ref 1)))) - (type (;5;) (func (param (ref 3)))) - (type (;6;) (func (param (ref 4)))) + (type $s1 (;1;) (func (param i32 (ref $s0)) (result (ref $s0)))) + (type $s2 (;2;) (func (param i32 (ref $s0)) (result (ref $s0)))) + (type $t1 (;3;) (func (param (ref $s1)) (result (ref $s2)))) + (type $t2 (;4;) (func (param (ref $s2)) (result (ref $s1)))) + (type (;5;) (func (param (ref $t1)))) + (type (;6;) (func (param (ref $t2)))) (import "N" "f1" (func (;0;) (type 5))) (import "N" "f1" (func (;1;) (type 6))) (import "N" "f2" (func (;2;) (type 5))) diff --git a/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/2.print b/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/2.print index 1e9f98cd61..1b0bd293f4 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/2.print +++ b/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/2.print @@ -1,17 +1,17 @@ (module (rec - (type $t1 (;0;) (func (param i32 (ref 0)))) + (type $t1 (;0;) (func (param i32 (ref $t1)))) ) (rec - (type $t2 (;1;) (func (param i32 (ref 1)))) + (type $t2 (;1;) (func (param i32 (ref $t2)))) ) - (type (;2;) (func (param (ref 0)))) - (type (;3;) (func (param (ref 1)))) - (func $f1 (;0;) (type 2) (param $r (ref 0)) + (type (;2;) (func (param (ref $t1)))) + (type (;3;) (func (param (ref $t2)))) + (func $f1 (;0;) (type 2) (param $r (ref $t1)) local.get $r call $f2 ) - (func $f2 (;1;) (type 3) (param $r (ref 1)) + (func $f2 (;1;) (type 3) (param $r (ref $t2)) local.get $r call $f1 ) diff --git a/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/20.print b/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/20.print index 2d991d634f..80f1754ceb 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/20.print +++ b/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/20.print @@ -1,8 +1,8 @@ (module (rec - (type $t1 (;0;) (func (param i32 (ref 0)))) + (type $t1 (;0;) (func (param i32 (ref $t1)))) ) - (type (;1;) (func (param (ref 0)))) - (func (;0;) (type 1) (param (ref 0))) + (type (;1;) (func (param (ref $t1)))) + (func (;0;) (type 1) (param (ref $t1))) (export "f" (func 0)) ) diff --git a/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/22.print b/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/22.print index 448c499809..b2384e8a44 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/22.print +++ b/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/22.print @@ -1,7 +1,7 @@ (module (rec - (type $t2 (;0;) (func (param i32 (ref 0)))) + (type $t2 (;0;) (func (param i32 (ref $t2)))) ) - (type (;1;) (func (param (ref 0)))) + (type (;1;) (func (param (ref $t2)))) (import "Mr1" "f" (func (;0;) (type 1))) ) diff --git a/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/23.print b/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/23.print index 9898438687..f1956d65f2 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/23.print +++ b/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/23.print @@ -1,15 +1,15 @@ (module (rec - (type $t1 (;0;) (func (param i32 (ref 0)))) - (type $t2 (;1;) (func (param i32 (ref 2)))) - (type $t3 (;2;) (func (param i32 (ref 1)))) + (type $t1 (;0;) (func (param i32 (ref $t1)))) + (type $t2 (;1;) (func (param i32 (ref $t3)))) + (type $t3 (;2;) (func (param i32 (ref $t2)))) ) - (type (;3;) (func (param (ref 0)))) - (type (;4;) (func (param (ref 1)))) - (type (;5;) (func (param (ref 2)))) - (func (;0;) (type 3) (param (ref 0))) - (func (;1;) (type 4) (param (ref 1))) - (func (;2;) (type 5) (param (ref 2))) + (type (;3;) (func (param (ref $t1)))) + (type (;4;) (func (param (ref $t2)))) + (type (;5;) (func (param (ref $t3)))) + (func (;0;) (type 3) (param (ref $t1))) + (func (;1;) (type 4) (param (ref $t2))) + (func (;2;) (type 5) (param (ref $t3))) (export "f1" (func 0)) (export "f2" (func 1)) (export "f3" (func 2)) diff --git a/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/25.print b/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/25.print index 83cd9ea268..b9676a056a 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/25.print +++ b/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/25.print @@ -1,12 +1,12 @@ (module (rec - (type $t1 (;0;) (func (param i32 (ref 0)))) - (type $t2 (;1;) (func (param i32 (ref 2)))) - (type $t3 (;2;) (func (param i32 (ref 1)))) + (type $t1 (;0;) (func (param i32 (ref $t1)))) + (type $t2 (;1;) (func (param i32 (ref $t3)))) + (type $t3 (;2;) (func (param i32 (ref $t2)))) ) - (type (;3;) (func (param (ref 0)))) - (type (;4;) (func (param (ref 1)))) - (type (;5;) (func (param (ref 2)))) + (type (;3;) (func (param (ref $t1)))) + (type (;4;) (func (param (ref $t2)))) + (type (;5;) (func (param (ref $t3)))) (import "Mr2" "f1" (func (;0;) (type 3))) (import "Mr2" "f2" (func (;1;) (type 4))) (import "Mr2" "f3" (func (;2;) (type 5))) diff --git a/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/26.print b/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/26.print index e7d23c3503..8ea47fabc6 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/26.print +++ b/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/26.print @@ -1,15 +1,15 @@ (module (rec - (type $t1 (;0;) (func (param i32 (ref 2)))) - (type $t2 (;1;) (func (param i32 (ref 0)))) - (type $t3 (;2;) (func (param i32 (ref 1)))) + (type $t1 (;0;) (func (param i32 (ref $t3)))) + (type $t2 (;1;) (func (param i32 (ref $t1)))) + (type $t3 (;2;) (func (param i32 (ref $t2)))) ) - (type (;3;) (func (param (ref 0)))) - (type (;4;) (func (param (ref 1)))) - (type (;5;) (func (param (ref 2)))) - (func (;0;) (type 3) (param (ref 0))) - (func (;1;) (type 4) (param (ref 1))) - (func (;2;) (type 5) (param (ref 2))) + (type (;3;) (func (param (ref $t1)))) + (type (;4;) (func (param (ref $t2)))) + (type (;5;) (func (param (ref $t3)))) + (func (;0;) (type 3) (param (ref $t1))) + (func (;1;) (type 4) (param (ref $t2))) + (func (;2;) (type 5) (param (ref $t3))) (export "f1" (func 0)) (export "f2" (func 1)) (export "f3" (func 2)) diff --git a/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/28.print b/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/28.print index 878e263cbb..cbb9061192 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/28.print +++ b/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/28.print @@ -1,12 +1,12 @@ (module (rec - (type $t1 (;0;) (func (param i32 (ref 2)))) - (type $t2 (;1;) (func (param i32 (ref 0)))) - (type $t3 (;2;) (func (param i32 (ref 1)))) + (type $t1 (;0;) (func (param i32 (ref $t3)))) + (type $t2 (;1;) (func (param i32 (ref $t1)))) + (type $t3 (;2;) (func (param i32 (ref $t2)))) ) - (type (;3;) (func (param (ref 0)))) - (type (;4;) (func (param (ref 1)))) - (type (;5;) (func (param (ref 2)))) + (type (;3;) (func (param (ref $t1)))) + (type (;4;) (func (param (ref $t2)))) + (type (;5;) (func (param (ref $t3)))) (import "Mr3" "f1" (func (;0;) (type 3))) (import "Mr3" "f2" (func (;1;) (type 4))) (import "Mr3" "f3" (func (;2;) (type 5))) diff --git a/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/29.print b/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/29.print index 36ac7de923..64e1999cc9 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/29.print +++ b/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/29.print @@ -1,20 +1,20 @@ (module (rec - (type $t1 (;0;) (func (param i32 (ref 1)))) - (type $u1 (;1;) (func (param f32 (ref 0)))) + (type $t1 (;0;) (func (param i32 (ref $u1)))) + (type $u1 (;1;) (func (param f32 (ref $t1)))) ) (rec - (type $t2 (;2;) (func (param i32 (ref 5)))) - (type $u2 (;3;) (func (param f32 (ref 4)))) - (type $t3 (;4;) (func (param i32 (ref 3)))) - (type $u3 (;5;) (func (param f32 (ref 2)))) + (type $t2 (;2;) (func (param i32 (ref $u3)))) + (type $u2 (;3;) (func (param f32 (ref $t3)))) + (type $t3 (;4;) (func (param i32 (ref $u2)))) + (type $u3 (;5;) (func (param f32 (ref $t2)))) ) - (type (;6;) (func (param (ref 0)))) - (type (;7;) (func (param (ref 2)))) - (type (;8;) (func (param (ref 4)))) - (func (;0;) (type 6) (param (ref 0))) - (func (;1;) (type 7) (param (ref 2))) - (func (;2;) (type 8) (param (ref 4))) + (type (;6;) (func (param (ref $t1)))) + (type (;7;) (func (param (ref $t2)))) + (type (;8;) (func (param (ref $t3)))) + (func (;0;) (type 6) (param (ref $t1))) + (func (;1;) (type 7) (param (ref $t2))) + (func (;2;) (type 8) (param (ref $t3))) (export "f1" (func 0)) (export "f2" (func 1)) (export "f3" (func 2)) diff --git a/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/3.print b/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/3.print index e5c414acfc..e5e41fe0ac 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/3.print +++ b/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/3.print @@ -1,13 +1,13 @@ (module - (type $t1 (;0;) (func (param i32 (ref 0)))) - (type $t2 (;1;) (func (param i32 (ref 1)))) - (type (;2;) (func (param (ref 0)))) - (type (;3;) (func (param (ref 1)))) - (func $f1 (;0;) (type 2) (param $r (ref 0)) + (type $t1 (;0;) (func (param i32 (ref $t1)))) + (type $t2 (;1;) (func (param i32 (ref $t2)))) + (type (;2;) (func (param (ref $t1)))) + (type (;3;) (func (param (ref $t2)))) + (func $f1 (;0;) (type 2) (param $r (ref $t1)) local.get $r call $f2 ) - (func $f2 (;1;) (type 3) (param $r (ref 1)) + (func $f2 (;1;) (type 3) (param $r (ref $t2)) local.get $r call $f1 ) diff --git a/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/31.print b/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/31.print index ae90a62640..850e57f4cf 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/31.print +++ b/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/31.print @@ -1,17 +1,17 @@ (module (rec - (type $t1 (;0;) (func (param i32 (ref 1)))) - (type $u1 (;1;) (func (param f32 (ref 0)))) + (type $t1 (;0;) (func (param i32 (ref $u1)))) + (type $u1 (;1;) (func (param f32 (ref $t1)))) ) (rec - (type $t2 (;2;) (func (param i32 (ref 5)))) - (type $u2 (;3;) (func (param f32 (ref 4)))) - (type $t3 (;4;) (func (param i32 (ref 3)))) - (type $u3 (;5;) (func (param f32 (ref 2)))) + (type $t2 (;2;) (func (param i32 (ref $u3)))) + (type $u2 (;3;) (func (param f32 (ref $t3)))) + (type $t3 (;4;) (func (param i32 (ref $u2)))) + (type $u3 (;5;) (func (param f32 (ref $t2)))) ) - (type (;6;) (func (param (ref 0)))) - (type (;7;) (func (param (ref 2)))) - (type (;8;) (func (param (ref 4)))) + (type (;6;) (func (param (ref $t1)))) + (type (;7;) (func (param (ref $t2)))) + (type (;8;) (func (param (ref $t3)))) (import "Mr4" "f1" (func (;0;) (type 6))) (import "Mr4" "f2" (func (;1;) (type 7))) (import "Mr4" "f3" (func (;2;) (type 8))) diff --git a/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/4.print b/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/4.print index ee947cbe70..57902a1d70 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/4.print +++ b/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/4.print @@ -1,29 +1,29 @@ (module (rec - (type $t0 (;0;) (func (param i32 (ref 1)))) - (type $t1 (;1;) (func (param i32 (ref 0)))) + (type $t0 (;0;) (func (param i32 (ref $t1)))) + (type $t1 (;1;) (func (param i32 (ref $t0)))) ) (rec - (type $t2 (;2;) (func (param i32 (ref 3)))) - (type $t3 (;3;) (func (param i32 (ref 2)))) + (type $t2 (;2;) (func (param i32 (ref $t3)))) + (type $t3 (;3;) (func (param i32 (ref $t2)))) ) - (type (;4;) (func (param (ref 0)))) - (type (;5;) (func (param (ref 1)))) - (type (;6;) (func (param (ref 2)))) - (type (;7;) (func (param (ref 3)))) - (func $f0 (;0;) (type 4) (param $r (ref 0)) + (type (;4;) (func (param (ref $t0)))) + (type (;5;) (func (param (ref $t1)))) + (type (;6;) (func (param (ref $t2)))) + (type (;7;) (func (param (ref $t3)))) + (func $f0 (;0;) (type 4) (param $r (ref $t0)) local.get $r call $f2 ) - (func $f1 (;1;) (type 5) (param $r (ref 1)) + (func $f1 (;1;) (type 5) (param $r (ref $t1)) local.get $r call $f3 ) - (func $f2 (;2;) (type 6) (param $r (ref 2)) + (func $f2 (;2;) (type 6) (param $r (ref $t2)) local.get $r call $f0 ) - (func $f3 (;3;) (type 7) (param $r (ref 3)) + (func $f3 (;3;) (type 7) (param $r (ref $t3)) local.get $r call $f1 ) diff --git a/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/8.print b/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/8.print index ea0aae42cf..7a8741b793 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/8.print +++ b/tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/8.print @@ -1,14 +1,14 @@ (module (type $s0 (;0;) (func (param i32))) - (type $s1 (;1;) (func (param i32 (ref 0)))) - (type $s2 (;2;) (func (param i32 (ref 0)))) - (type $t1 (;3;) (func (param (ref 1)))) - (type $t2 (;4;) (func (param (ref 2)))) + (type $s1 (;1;) (func (param i32 (ref $s0)))) + (type $s2 (;2;) (func (param i32 (ref $s0)))) + (type $t1 (;3;) (func (param (ref $s1)))) + (type $t2 (;4;) (func (param (ref $s2)))) (type (;5;) (func)) - (func $s1 (;0;) (type $s1) (param i32 (ref 0))) - (func $s2 (;1;) (type $s2) (param i32 (ref 0))) - (func $f1 (;2;) (type $t1) (param (ref 1))) - (func $f2 (;3;) (type $t2) (param (ref 2))) + (func $s1 (;0;) (type $s1) (param i32 (ref $s0))) + (func $s2 (;1;) (type $s2) (param i32 (ref $s0))) + (func $f1 (;2;) (type $t1) (param (ref $s1))) + (func $f2 (;3;) (type $t2) (param (ref $s2))) (func (;4;) (type 5) ref.func $s1 i32.const 0 diff --git a/tests/snapshots/testsuite/proposals/gc/type-rec.wast/0.print b/tests/snapshots/testsuite/proposals/gc/type-rec.wast/0.print index aec1fd770a..b30ff3c506 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-rec.wast/0.print +++ b/tests/snapshots/testsuite/proposals/gc/type-rec.wast/0.print @@ -1,12 +1,12 @@ (module (rec (type $f1 (;0;) (func)) - (type (;1;) (struct (field (ref 0)))) + (type (;1;) (struct (field (ref $f1)))) ) (rec (type $f2 (;2;) (func)) - (type (;3;) (struct (field (ref 2)))) + (type (;3;) (struct (field (ref $f2)))) ) (func $f (;0;) (type $f2)) - (global (;0;) (ref 0) ref.func $f) + (global (;0;) (ref $f1) ref.func $f) ) diff --git a/tests/snapshots/testsuite/proposals/gc/type-rec.wast/1.print b/tests/snapshots/testsuite/proposals/gc/type-rec.wast/1.print index a8b267477e..85d75cb372 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-rec.wast/1.print +++ b/tests/snapshots/testsuite/proposals/gc/type-rec.wast/1.print @@ -1,20 +1,20 @@ (module (rec (type $f1 (;0;) (func)) - (type (;1;) (struct (field (ref 0)))) + (type (;1;) (struct (field (ref $f1)))) ) (rec (type $f2 (;2;) (func)) - (type (;3;) (struct (field (ref 2)))) + (type (;3;) (struct (field (ref $f2)))) ) (rec (type $g1 (;4;) (func)) - (type (;5;) (struct (field (ref 0)) (field (ref 0)) (field (ref 2)) (field (ref 2)) (field (ref 4)))) + (type (;5;) (struct (field (ref $f1)) (field (ref $f1)) (field (ref $f2)) (field (ref $f2)) (field (ref $g1)))) ) (rec (type $g2 (;6;) (func)) - (type (;7;) (struct (field (ref 0)) (field (ref 2)) (field (ref 0)) (field (ref 2)) (field (ref 6)))) + (type (;7;) (struct (field (ref $f1)) (field (ref $f2)) (field (ref $f1)) (field (ref $f2)) (field (ref $g2)))) ) (func $g (;0;) (type $g2)) - (global (;0;) (ref 4) ref.func $g) + (global (;0;) (ref $g1) ref.func $g) ) diff --git a/tests/snapshots/testsuite/proposals/gc/type-rec.wast/17.print b/tests/snapshots/testsuite/proposals/gc/type-rec.wast/17.print index 9f8f88abb6..1c8a861bef 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-rec.wast/17.print +++ b/tests/snapshots/testsuite/proposals/gc/type-rec.wast/17.print @@ -3,9 +3,9 @@ (type $s (;0;) (struct)) ) (rec - (type $t (;1;) (func (param (ref 0)))) + (type $t (;1;) (func (param (ref $s)))) ) - (type (;2;) (func (param (ref 0)))) - (func $f (;0;) (type 2) (param (ref 0))) - (global (;0;) (ref 1) ref.func $f) + (type (;2;) (func (param (ref $s)))) + (func $f (;0;) (type 2) (param (ref $s))) + (global (;0;) (ref $t) ref.func $f) ) diff --git a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/0.print b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/0.print index 4201d2af22..35679ff956 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/0.print +++ b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/0.print @@ -2,8 +2,8 @@ (type $e0 (;0;) (sub (array i32))) (type $e1 (;1;) (sub $e0 (array i32))) (type $e2 (;2;) (sub (array anyref))) - (type $e3 (;3;) (sub (array (ref null 0)))) - (type $e4 (;4;) (sub (array (ref 1)))) + (type $e3 (;3;) (sub (array (ref null $e0)))) + (type $e4 (;4;) (sub (array (ref $e1)))) (type $m1 (;5;) (sub (array (mut i32)))) (type $m2 (;6;) (sub $m1 (array (mut i32)))) ) diff --git a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/1.print b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/1.print index 66383bb384..7608033e21 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/1.print +++ b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/1.print @@ -2,7 +2,7 @@ (type $e0 (;0;) (sub (struct))) (type $e1 (;1;) (sub $e0 (struct))) (type $e2 (;2;) (sub $e1 (struct (field i32)))) - (type $e3 (;3;) (sub $e2 (struct (field i32) (field (ref null 0))))) - (type $e4 (;4;) (sub $e3 (struct (field i32) (field (ref 0)) (field (mut i64))))) - (type $e5 (;5;) (sub $e4 (struct (field i32) (field (ref 1)) (field (mut i64))))) + (type $e3 (;3;) (sub $e2 (struct (field i32) (field (ref null $e0))))) + (type $e4 (;4;) (sub $e3 (struct (field i32) (field (ref $e0)) (field (mut i64))))) + (type $e5 (;5;) (sub $e4 (struct (field i32) (field (ref $e1)) (field (mut i64))))) ) diff --git a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/11.print b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/11.print index d99bb17549..818a6c3a4f 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/11.print +++ b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/11.print @@ -1,16 +1,16 @@ (module (rec (type $f1 (;0;) (sub (func))) - (type (;1;) (struct (field (ref 0)))) + (type (;1;) (struct (field (ref $f1)))) ) (rec (type $f2 (;2;) (sub (func))) - (type (;3;) (struct (field (ref 2)))) + (type (;3;) (struct (field (ref $f2)))) ) (rec (type $g (;4;) (sub $f1 (func))) (type (;5;) (struct)) ) (func $g (;0;) (type $g)) - (global (;0;) (ref 0) ref.func $g) + (global (;0;) (ref $f1) ref.func $g) ) diff --git a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/12.print b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/12.print index 9a2816ccc6..e349860da2 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/12.print +++ b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/12.print @@ -1,25 +1,25 @@ (module (rec (type $f1 (;0;) (sub (func))) - (type $s1 (;1;) (sub (struct (field (ref 0))))) + (type $s1 (;1;) (sub (struct (field (ref $f1))))) ) (rec (type $f2 (;2;) (sub (func))) - (type $s2 (;3;) (sub (struct (field (ref 2))))) + (type $s2 (;3;) (sub (struct (field (ref $f2))))) ) (rec (type $g1 (;4;) (sub $f1 (func))) - (type (;5;) (sub $s1 (struct (field (ref 0)) (field (ref 0)) (field (ref 2)) (field (ref 2)) (field (ref 4))))) + (type (;5;) (sub $s1 (struct (field (ref $f1)) (field (ref $f1)) (field (ref $f2)) (field (ref $f2)) (field (ref $g1))))) ) (rec (type $g2 (;6;) (sub $f2 (func))) - (type (;7;) (sub $s2 (struct (field (ref 0)) (field (ref 2)) (field (ref 0)) (field (ref 2)) (field (ref 6))))) + (type (;7;) (sub $s2 (struct (field (ref $f1)) (field (ref $f2)) (field (ref $f1)) (field (ref $f2)) (field (ref $g2))))) ) (rec (type $h (;8;) (sub $g2 (func))) (type (;9;) (struct)) ) (func $h (;0;) (type $h)) - (global (;0;) (ref 0) ref.func $h) - (global (;1;) (ref 4) ref.func $h) + (global (;0;) (ref $f1) ref.func $h) + (global (;1;) (ref $g1) ref.func $h) ) diff --git a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/13.print b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/13.print index 1fcbc4fa48..f98f044e99 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/13.print +++ b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/13.print @@ -1,20 +1,20 @@ (module (rec (type $f11 (;0;) (sub (func (result (ref func))))) - (type $f12 (;1;) (sub $f11 (func (result (ref 0))))) + (type $f12 (;1;) (sub $f11 (func (result (ref $f11))))) ) (rec (type $f21 (;2;) (sub (func (result (ref func))))) - (type $f22 (;3;) (sub $f21 (func (result (ref 2))))) + (type $f22 (;3;) (sub $f21 (func (result (ref $f21))))) ) (func $f11 (;0;) (type $f11) (result (ref func)) unreachable ) - (func $f12 (;1;) (type $f12) (result (ref 0)) + (func $f12 (;1;) (type $f12) (result (ref $f11)) unreachable ) - (global (;0;) (ref 0) ref.func $f11) - (global (;1;) (ref 2) ref.func $f11) - (global (;2;) (ref 1) ref.func $f12) - (global (;3;) (ref 3) ref.func $f12) + (global (;0;) (ref $f11) ref.func $f11) + (global (;1;) (ref $f21) ref.func $f11) + (global (;2;) (ref $f12) ref.func $f12) + (global (;3;) (ref $f22) ref.func $f12) ) diff --git a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/14.print b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/14.print index f7cf76f779..8961773ebc 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/14.print +++ b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/14.print @@ -1,32 +1,32 @@ (module (rec (type $f11 (;0;) (sub (func (result (ref func))))) - (type $f12 (;1;) (sub $f11 (func (result (ref 0))))) + (type $f12 (;1;) (sub $f11 (func (result (ref $f11))))) ) (rec (type $f21 (;2;) (sub (func (result (ref func))))) - (type $f22 (;3;) (sub $f21 (func (result (ref 2))))) + (type $f22 (;3;) (sub $f21 (func (result (ref $f21))))) ) (rec (type $g11 (;4;) (sub $f11 (func (result (ref func))))) - (type $g12 (;5;) (sub $g11 (func (result (ref 4))))) + (type $g12 (;5;) (sub $g11 (func (result (ref $g11))))) ) (rec (type $g21 (;6;) (sub $f21 (func (result (ref func))))) - (type $g22 (;7;) (sub $g21 (func (result (ref 6))))) + (type $g22 (;7;) (sub $g21 (func (result (ref $g21))))) ) (func $g11 (;0;) (type $g11) (result (ref func)) unreachable ) - (func $g12 (;1;) (type $g12) (result (ref 4)) + (func $g12 (;1;) (type $g12) (result (ref $g11)) unreachable ) - (global (;0;) (ref 0) ref.func $g11) - (global (;1;) (ref 2) ref.func $g11) - (global (;2;) (ref 0) ref.func $g12) - (global (;3;) (ref 2) ref.func $g12) - (global (;4;) (ref 4) ref.func $g11) - (global (;5;) (ref 6) ref.func $g11) - (global (;6;) (ref 5) ref.func $g12) - (global (;7;) (ref 7) ref.func $g12) + (global (;0;) (ref $f11) ref.func $g11) + (global (;1;) (ref $f21) ref.func $g11) + (global (;2;) (ref $f11) ref.func $g12) + (global (;3;) (ref $f21) ref.func $g12) + (global (;4;) (ref $g11) ref.func $g11) + (global (;5;) (ref $g21) ref.func $g11) + (global (;6;) (ref $g12) ref.func $g12) + (global (;7;) (ref $g22) ref.func $g12) ) diff --git a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/17.print b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/17.print index f427604ff9..269bc81a28 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/17.print +++ b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/17.print @@ -1,20 +1,20 @@ (module (type $t0 (;0;) (sub (func (result funcref)))) (rec - (type $t1 (;1;) (sub $t0 (func (result (ref null 1))))) + (type $t1 (;1;) (sub $t0 (func (result (ref null $t1))))) ) (rec - (type $t2 (;2;) (sub $t1 (func (result (ref null 2))))) + (type $t2 (;2;) (sub $t1 (func (result (ref null $t2))))) ) (type (;3;) (func)) (func $f0 (;0;) (type $t0) (result funcref) ref.null func ) - (func $f1 (;1;) (type $t1) (result (ref null 1)) - ref.null 1 + (func $f1 (;1;) (type $t1) (result (ref null $t1)) + ref.null $t1 ) - (func $f2 (;2;) (type $t2) (result (ref null 2)) - ref.null 2 + (func $f2 (;2;) (type $t2) (result (ref null $t2)) + ref.null $t2 ) (func (;3;) (type 3) block (result funcref) ;; label = @1 @@ -29,66 +29,66 @@ i32.const 2 call_indirect (type $t0) end - block (result (ref null 1)) ;; label = @1 + block (result (ref null $t1)) ;; label = @1 i32.const 1 call_indirect (type $t1) end - block (result (ref null 1)) ;; label = @1 + block (result (ref null $t1)) ;; label = @1 i32.const 2 call_indirect (type $t1) end - block (result (ref null 2)) ;; label = @1 + block (result (ref null $t2)) ;; label = @1 i32.const 2 call_indirect (type $t2) end - block (result (ref null 0)) ;; label = @1 + block (result (ref null $t0)) ;; label = @1 i32.const 0 table.get 0 - ref.cast (ref 0) + ref.cast (ref $t0) end - block (result (ref null 0)) ;; label = @1 + block (result (ref null $t0)) ;; label = @1 i32.const 1 table.get 0 - ref.cast (ref 0) + ref.cast (ref $t0) end - block (result (ref null 0)) ;; label = @1 + block (result (ref null $t0)) ;; label = @1 i32.const 2 table.get 0 - ref.cast (ref 0) + ref.cast (ref $t0) end - block (result (ref null 1)) ;; label = @1 + block (result (ref null $t1)) ;; label = @1 i32.const 1 table.get 0 - ref.cast (ref 1) + ref.cast (ref $t1) end - block (result (ref null 1)) ;; label = @1 + block (result (ref null $t1)) ;; label = @1 i32.const 2 table.get 0 - ref.cast (ref 1) + ref.cast (ref $t1) end - block (result (ref null 2)) ;; label = @1 + block (result (ref null $t2)) ;; label = @1 i32.const 2 table.get 0 - ref.cast (ref 2) + ref.cast (ref $t2) end br 0 (;@0;) ) (func (;4;) (type 3) - block (result (ref null 1)) ;; label = @1 + block (result (ref null $t1)) ;; label = @1 i32.const 0 call_indirect (type $t1) end br 0 (;@0;) ) (func (;5;) (type 3) - block (result (ref null 1)) ;; label = @1 + block (result (ref null $t1)) ;; label = @1 i32.const 0 call_indirect (type $t2) end br 0 (;@0;) ) (func (;6;) (type 3) - block (result (ref null 1)) ;; label = @1 + block (result (ref null $t1)) ;; label = @1 i32.const 1 call_indirect (type $t2) end @@ -97,19 +97,19 @@ (func (;7;) (type 3) i32.const 0 table.get 0 - ref.cast (ref 1) + ref.cast (ref $t1) br 0 (;@0;) ) (func (;8;) (type 3) i32.const 0 table.get 0 - ref.cast (ref 2) + ref.cast (ref $t2) br 0 (;@0;) ) (func (;9;) (type 3) i32.const 1 table.get 0 - ref.cast (ref 2) + ref.cast (ref $t2) br 0 (;@0;) ) (table (;0;) 3 3 funcref) diff --git a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/2.print b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/2.print index 275cc61aa2..52521cefc5 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/2.print +++ b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/2.print @@ -1,8 +1,8 @@ (module (type $s (;0;) (sub (struct))) (type $s' (;1;) (sub $s (struct))) - (type $f1 (;2;) (sub (func (param (ref 1)) (result anyref)))) - (type $f2 (;3;) (sub $f1 (func (param (ref 0)) (result (ref any))))) - (type $f3 (;4;) (sub $f2 (func (param (ref null 0)) (result (ref 0))))) - (type $f4 (;5;) (sub $f3 (func (param structref) (result (ref 1))))) + (type $f1 (;2;) (sub (func (param (ref $s')) (result anyref)))) + (type $f2 (;3;) (sub $f1 (func (param (ref $s)) (result (ref any))))) + (type $f3 (;4;) (sub $f2 (func (param (ref null $s)) (result (ref $s))))) + (type $f4 (;5;) (sub $f3 (func (param structref) (result (ref $s'))))) ) diff --git a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/25.print b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/25.print index 53c512d6bb..7a3c81e1ed 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/25.print +++ b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/25.print @@ -18,13 +18,13 @@ (func (;4;) (type $t1) i32.const 1 table.get 0 - ref.cast (ref 0) + ref.cast (ref $t1) drop ) (func (;5;) (type $t1) i32.const 0 table.get 0 - ref.cast (ref 1) + ref.cast (ref $t2) drop ) (table (;0;) 2 2 funcref) diff --git a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/3.print b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/3.print index fe545455c8..870d16fa26 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/3.print +++ b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/3.print @@ -1,7 +1,7 @@ (module (type $t (;0;) (sub (struct (field anyref)))) (rec - (type $r (;1;) (sub $t (struct (field (ref 1))))) + (type $r (;1;) (sub $t (struct (field (ref $r))))) ) - (type $t' (;2;) (sub $r (struct (field (ref 1)) (field i32)))) + (type $t' (;2;) (sub $r (struct (field (ref $r)) (field i32)))) ) diff --git a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/30.print b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/30.print index 7ea9ee51cd..52fbaef1df 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/30.print +++ b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/30.print @@ -1,11 +1,11 @@ (module (rec (type $f1 (;0;) (sub (func))) - (type (;1;) (struct (field (ref 0)))) + (type (;1;) (struct (field (ref $f1)))) ) (rec (type $f2 (;2;) (sub (func))) - (type (;3;) (struct (field (ref 2)))) + (type (;3;) (struct (field (ref $f2)))) ) (rec (type $g1 (;4;) (sub $f1 (func))) @@ -19,7 +19,7 @@ (func $g (;0;) (type $g2)) (func (;1;) (type 8) (result i32) ref.func $g - ref.test (ref 4) + ref.test (ref $g1) ) (export "run" (func 1)) (elem (;0;) declare func $g) diff --git a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/32.print b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/32.print index 5bfac5bbdb..73d9873650 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/32.print +++ b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/32.print @@ -1,25 +1,25 @@ (module (rec (type $f1 (;0;) (sub (func))) - (type $s1 (;1;) (sub (struct (field (ref 0))))) + (type $s1 (;1;) (sub (struct (field (ref $f1))))) ) (rec (type $f2 (;2;) (sub (func))) - (type $s2 (;3;) (sub (struct (field (ref 2))))) + (type $s2 (;3;) (sub (struct (field (ref $f2))))) ) (rec (type $g1 (;4;) (sub $f1 (func))) - (type (;5;) (sub $s1 (struct (field (ref 0)) (field (ref 0)) (field (ref 2)) (field (ref 2)) (field (ref 4))))) + (type (;5;) (sub $s1 (struct (field (ref $f1)) (field (ref $f1)) (field (ref $f2)) (field (ref $f2)) (field (ref $g1))))) ) (rec (type $g2 (;6;) (sub $f2 (func))) - (type (;7;) (sub $s2 (struct (field (ref 0)) (field (ref 2)) (field (ref 0)) (field (ref 2)) (field (ref 6))))) + (type (;7;) (sub $s2 (struct (field (ref $f1)) (field (ref $f2)) (field (ref $f1)) (field (ref $f2)) (field (ref $g2))))) ) (type (;8;) (func (result i32))) (func $g (;0;) (type $g2)) (func (;1;) (type 8) (result i32) ref.func $g - ref.test (ref 4) + ref.test (ref $g1) ) (export "run" (func 1)) (elem (;0;) declare func $g) diff --git a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/34.print b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/34.print index 8eb3877ea6..e7269e968a 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/34.print +++ b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/34.print @@ -1,11 +1,11 @@ (module (rec (type $f1 (;0;) (sub (func))) - (type (;1;) (struct (field (ref 0)))) + (type (;1;) (struct (field (ref $f1)))) ) (rec (type $f2 (;2;) (sub (func))) - (type (;3;) (struct (field (ref 0)))) + (type (;3;) (struct (field (ref $f1)))) ) (rec (type $g1 (;4;) (sub $f1 (func))) @@ -19,7 +19,7 @@ (func $g (;0;) (type $g2)) (func (;1;) (type 8) (result i32) ref.func $g - ref.test (ref 4) + ref.test (ref $g1) ) (export "run" (func 1)) (elem (;0;) declare func $g) diff --git a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/36.print b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/36.print index eae9c59719..943f1ccd5e 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/36.print +++ b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/36.print @@ -1,11 +1,11 @@ (module (rec (type $f1 (;0;) (sub (func))) - (type (;1;) (struct (field (ref 0)))) + (type (;1;) (struct (field (ref $f1)))) ) (rec (type $f2 (;2;) (sub (func))) - (type (;3;) (struct (field (ref 2)))) + (type (;3;) (struct (field (ref $f2)))) ) (rec (type $g (;4;) (sub $f1 (func))) @@ -15,7 +15,7 @@ (func $g (;0;) (type $g)) (func (;1;) (type 6) (result i32) ref.func $g - ref.test (ref 0) + ref.test (ref $f1) ) (export "run" (func 1)) (elem (;0;) declare func $g) diff --git a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/38.print b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/38.print index 7ee3fbc58d..4c6a454975 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/38.print +++ b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/38.print @@ -1,19 +1,19 @@ (module (rec (type $f1 (;0;) (sub (func))) - (type $s1 (;1;) (sub (struct (field (ref 0))))) + (type $s1 (;1;) (sub (struct (field (ref $f1))))) ) (rec (type $f2 (;2;) (sub (func))) - (type $s2 (;3;) (sub (struct (field (ref 2))))) + (type $s2 (;3;) (sub (struct (field (ref $f2))))) ) (rec (type $g1 (;4;) (sub $f1 (func))) - (type (;5;) (sub $s1 (struct (field (ref 0)) (field (ref 0)) (field (ref 2)) (field (ref 2)) (field (ref 4))))) + (type (;5;) (sub $s1 (struct (field (ref $f1)) (field (ref $f1)) (field (ref $f2)) (field (ref $f2)) (field (ref $g1))))) ) (rec (type $g2 (;6;) (sub $f2 (func))) - (type (;7;) (sub $s2 (struct (field (ref 0)) (field (ref 2)) (field (ref 0)) (field (ref 2)) (field (ref 6))))) + (type (;7;) (sub $s2 (struct (field (ref $f1)) (field (ref $f2)) (field (ref $f1)) (field (ref $f2)) (field (ref $g2))))) ) (rec (type $h (;8;) (sub $g2 (func))) @@ -23,9 +23,9 @@ (func $h (;0;) (type $h)) (func (;1;) (type 10) (result i32 i32) ref.func $h - ref.test (ref 0) + ref.test (ref $f1) ref.func $h - ref.test (ref 4) + ref.test (ref $g1) ) (export "run" (func 1)) (elem (;0;) declare func $h) diff --git a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/4.print b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/4.print index 517d86e508..0e68b11416 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/4.print +++ b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/4.print @@ -1,9 +1,9 @@ (module (rec - (type $r1 (;0;) (sub (struct (field i32) (field (ref 0))))) + (type $r1 (;0;) (sub (struct (field i32) (field (ref $r1))))) ) (rec - (type $r2 (;1;) (sub $r1 (struct (field i32) (field (ref 2))))) - (type $r3 (;2;) (sub $r1 (struct (field i32) (field (ref 1))))) + (type $r2 (;1;) (sub $r1 (struct (field i32) (field (ref $r3))))) + (type $r3 (;2;) (sub $r1 (struct (field i32) (field (ref $r2))))) ) ) diff --git a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/40.print b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/40.print index 6b716dd980..26645c88d5 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/40.print +++ b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/40.print @@ -1,28 +1,28 @@ (module (rec (type $f11 (;0;) (sub (func (result (ref func))))) - (type $f12 (;1;) (sub $f11 (func (result (ref 0))))) + (type $f12 (;1;) (sub $f11 (func (result (ref $f11))))) ) (rec (type $f21 (;2;) (sub (func (result (ref func))))) - (type $f22 (;3;) (sub $f21 (func (result (ref 2))))) + (type $f22 (;3;) (sub $f21 (func (result (ref $f21))))) ) (type (;4;) (func (result i32 i32 i32 i32))) (func $f11 (;0;) (type $f11) (result (ref func)) unreachable ) - (func $f12 (;1;) (type $f12) (result (ref 0)) + (func $f12 (;1;) (type $f12) (result (ref $f11)) unreachable ) (func (;2;) (type 4) (result i32 i32 i32 i32) ref.func $f11 - ref.test (ref 0) + ref.test (ref $f11) ref.func $f11 - ref.test (ref 2) + ref.test (ref $f21) ref.func $f12 - ref.test (ref 1) + ref.test (ref $f12) ref.func $f12 - ref.test (ref 3) + ref.test (ref $f22) ) (export "run" (func 2)) (elem (;0;) declare func $f11) diff --git a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/42.print b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/42.print index e11aa06889..8b073a6d51 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/42.print +++ b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/42.print @@ -1,44 +1,44 @@ (module (rec (type $f11 (;0;) (sub (func (result (ref func))))) - (type $f12 (;1;) (sub $f11 (func (result (ref 0))))) + (type $f12 (;1;) (sub $f11 (func (result (ref $f11))))) ) (rec (type $f21 (;2;) (sub (func (result (ref func))))) - (type $f22 (;3;) (sub $f21 (func (result (ref 2))))) + (type $f22 (;3;) (sub $f21 (func (result (ref $f21))))) ) (rec (type $g11 (;4;) (sub $f11 (func (result (ref func))))) - (type $g12 (;5;) (sub $g11 (func (result (ref 4))))) + (type $g12 (;5;) (sub $g11 (func (result (ref $g11))))) ) (rec (type $g21 (;6;) (sub $f21 (func (result (ref func))))) - (type $g22 (;7;) (sub $g21 (func (result (ref 6))))) + (type $g22 (;7;) (sub $g21 (func (result (ref $g21))))) ) (type (;8;) (func (result i32 i32 i32 i32 i32 i32 i32 i32))) (func $g11 (;0;) (type $g11) (result (ref func)) unreachable ) - (func $g12 (;1;) (type $g12) (result (ref 4)) + (func $g12 (;1;) (type $g12) (result (ref $g11)) unreachable ) (func (;2;) (type 8) (result i32 i32 i32 i32 i32 i32 i32 i32) ref.func $g11 - ref.test (ref 0) + ref.test (ref $f11) ref.func $g11 - ref.test (ref 2) + ref.test (ref $f21) ref.func $g12 - ref.test (ref 0) + ref.test (ref $f11) ref.func $g12 - ref.test (ref 2) + ref.test (ref $f21) ref.func $g11 - ref.test (ref 4) + ref.test (ref $g11) ref.func $g11 - ref.test (ref 6) + ref.test (ref $g21) ref.func $g12 - ref.test (ref 5) + ref.test (ref $g12) ref.func $g12 - ref.test (ref 7) + ref.test (ref $g22) ) (export "run" (func 2)) (elem (;0;) declare func $g11) diff --git a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/44.print b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/44.print index 2444848c97..79dea0e0a5 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/44.print +++ b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/44.print @@ -11,7 +11,7 @@ (func $f (;0;) (type $f21)) (func (;1;) (type 4) (result i32) ref.func $f - ref.test (ref 0) + ref.test (ref $f11) ) (export "run" (func 1)) (elem (;0;) declare func $f) diff --git a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/46.print b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/46.print index 44ec11778c..57d5a2dbb8 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/46.print +++ b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/46.print @@ -15,7 +15,7 @@ (func $f (;0;) (type $f21)) (func (;1;) (type 6) (result i32) ref.func $f - ref.test (ref 2) + ref.test (ref $f11) ) (export "run" (func 1)) (elem (;0;) declare func $f) diff --git a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/48.print b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/48.print index 8cf61ab00e..5b1fc39f0e 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/48.print +++ b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/48.print @@ -1,19 +1,19 @@ (module (type $t0 (;0;) (sub (func (result funcref)))) (rec - (type $t1 (;1;) (sub $t0 (func (result (ref null 1))))) + (type $t1 (;1;) (sub $t0 (func (result (ref null $t1))))) ) (rec - (type $t2 (;2;) (sub $t1 (func (result (ref null 2))))) + (type $t2 (;2;) (sub $t1 (func (result (ref null $t2))))) ) (func (;0;) (type $t0) (result funcref) ref.null func ) - (func (;1;) (type $t1) (result (ref null 1)) - ref.null 1 + (func (;1;) (type $t1) (result (ref null $t1)) + ref.null $t1 ) - (func (;2;) (type $t2) (result (ref null 2)) - ref.null 2 + (func (;2;) (type $t2) (result (ref null $t2)) + ref.null $t2 ) (export "f0" (func 0)) (export "f1" (func 1)) diff --git a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/5.print b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/5.print index da048d536b..32d2465774 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/5.print +++ b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/5.print @@ -1,11 +1,11 @@ (module (rec - (type $a1 (;0;) (sub (struct (field i32) (field (ref 1))))) - (type $a2 (;1;) (sub (struct (field i64) (field (ref 0))))) + (type $a1 (;0;) (sub (struct (field i32) (field (ref $a2))))) + (type $a2 (;1;) (sub (struct (field i64) (field (ref $a1))))) ) (rec - (type $b1 (;2;) (sub $a2 (struct (field i64) (field (ref 0)) (field i32)))) - (type $b2 (;3;) (sub $a1 (struct (field i32) (field (ref 1)) (field i32)))) - (type $b3 (;4;) (sub $a2 (struct (field i64) (field (ref 3)) (field i32)))) + (type $b1 (;2;) (sub $a2 (struct (field i64) (field (ref $a1)) (field i32)))) + (type $b2 (;3;) (sub $a1 (struct (field i32) (field (ref $a2)) (field i32)))) + (type $b3 (;4;) (sub $a2 (struct (field i64) (field (ref $b2)) (field i32)))) ) ) diff --git a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/50.print b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/50.print index ce4b2db21b..a318aa0c18 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/50.print +++ b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/50.print @@ -1,10 +1,10 @@ (module (type $t0 (;0;) (sub (func (result funcref)))) (rec - (type $t1 (;1;) (sub $t0 (func (result (ref null 1))))) + (type $t1 (;1;) (sub $t0 (func (result (ref null $t1))))) ) (rec - (type $t2 (;2;) (sub $t1 (func (result (ref null 2))))) + (type $t2 (;2;) (sub $t1 (func (result (ref null $t2))))) ) (import "M" "f0" (func (;0;) (type $t0))) (import "M" "f1" (func (;1;) (type $t0))) diff --git a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/58.print b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/58.print index 560f2dd762..166d73dbbd 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/58.print +++ b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/58.print @@ -1,7 +1,7 @@ (module (rec (type $f2 (;0;) (sub (func))) - (type (;1;) (struct (field (ref 0)))) + (type (;1;) (struct (field (ref $f2)))) ) (rec (type $g2 (;2;) (sub $f2 (func))) diff --git a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/6.print b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/6.print index bf2985b0ca..967e74210c 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/6.print +++ b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/6.print @@ -1,23 +1,23 @@ (module (rec - (type $t1 (;0;) (sub (func (param i32 (ref 2))))) - (type $t2 (;1;) (sub $t1 (func (param i32 (ref 1))))) - (type $t3 (;2;) (sub $t2 (func (param i32 (ref 0))))) + (type $t1 (;0;) (sub (func (param i32 (ref $t3))))) + (type $t2 (;1;) (sub $t1 (func (param i32 (ref $t2))))) + (type $t3 (;2;) (sub $t2 (func (param i32 (ref $t1))))) ) - (type (;3;) (func (param (ref 0)))) - (type (;4;) (func (param (ref 1)))) - (type (;5;) (func (param (ref 2)))) - (func $f1 (;0;) (type 3) (param $r (ref 0)) + (type (;3;) (func (param (ref $t1)))) + (type (;4;) (func (param (ref $t2)))) + (type (;5;) (func (param (ref $t3)))) + (func $f1 (;0;) (type 3) (param $r (ref $t1)) local.get $r call $f1 ) - (func $f2 (;1;) (type 4) (param $r (ref 1)) + (func $f2 (;1;) (type 4) (param $r (ref $t2)) local.get $r call $f1 local.get $r call $f2 ) - (func $f3 (;2;) (type 5) (param $r (ref 2)) + (func $f3 (;2;) (type 5) (param $r (ref $t3)) local.get $r call $f1 local.get $r diff --git a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/60.print b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/60.print index 3903b1a8d7..b1917adb71 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/60.print +++ b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/60.print @@ -1,7 +1,7 @@ (module (rec (type $f1 (;0;) (sub (func))) - (type (;1;) (struct (field (ref 0)))) + (type (;1;) (struct (field (ref $f1)))) ) (rec (type $g1 (;2;) (sub $f1 (func))) diff --git a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/61.print b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/61.print index 18fe676a98..311eba83f7 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/61.print +++ b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/61.print @@ -1,15 +1,15 @@ (module (rec (type $f1 (;0;) (sub (func))) - (type $s1 (;1;) (sub (struct (field (ref 0))))) + (type $s1 (;1;) (sub (struct (field (ref $f1))))) ) (rec (type $f2 (;2;) (sub (func))) - (type $s2 (;3;) (sub (struct (field (ref 2))))) + (type $s2 (;3;) (sub (struct (field (ref $f2))))) ) (rec (type $g2 (;4;) (sub $f2 (func))) - (type (;5;) (sub $s2 (struct (field (ref 0)) (field (ref 2)) (field (ref 0)) (field (ref 2)) (field (ref 4))))) + (type (;5;) (sub $s2 (struct (field (ref $f1)) (field (ref $f2)) (field (ref $f1)) (field (ref $f2)) (field (ref $g2))))) ) (func (;0;) (type $g2)) (export "g" (func 0)) diff --git a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/63.print b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/63.print index 88ee965808..d64d1bd057 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/63.print +++ b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/63.print @@ -1,15 +1,15 @@ (module (rec (type $f1 (;0;) (sub (func))) - (type $s1 (;1;) (sub (struct (field (ref 0))))) + (type $s1 (;1;) (sub (struct (field (ref $f1))))) ) (rec (type $f2 (;2;) (sub (func))) - (type $s2 (;3;) (sub (struct (field (ref 2))))) + (type $s2 (;3;) (sub (struct (field (ref $f2))))) ) (rec (type $g1 (;4;) (sub $f1 (func))) - (type (;5;) (sub $s1 (struct (field (ref 0)) (field (ref 0)) (field (ref 2)) (field (ref 2)) (field (ref 4))))) + (type (;5;) (sub $s1 (struct (field (ref $f1)) (field (ref $f1)) (field (ref $f2)) (field (ref $f2)) (field (ref $g1))))) ) (import "M4" "g" (func (;0;) (type $g1))) ) diff --git a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/64.print b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/64.print index e1759d6f5b..4933f3415d 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/64.print +++ b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/64.print @@ -1,11 +1,11 @@ (module (rec (type $f1 (;0;) (sub (func))) - (type (;1;) (struct (field (ref 0)))) + (type (;1;) (struct (field (ref $f1)))) ) (rec (type $f2 (;2;) (sub (func))) - (type (;3;) (struct (field (ref 0)))) + (type (;3;) (struct (field (ref $f1)))) ) (rec (type $g2 (;4;) (sub $f2 (func))) diff --git a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/67.print b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/67.print index 0f9fb4f6a6..650668d0a2 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/67.print +++ b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/67.print @@ -1,11 +1,11 @@ (module (rec (type $f1 (;0;) (sub (func))) - (type (;1;) (struct (field (ref 0)))) + (type (;1;) (struct (field (ref $f1)))) ) (rec (type $f2 (;2;) (sub (func))) - (type (;3;) (struct (field (ref 2)))) + (type (;3;) (struct (field (ref $f2)))) ) (rec (type $g (;4;) (sub $f1 (func))) diff --git a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/69.print b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/69.print index 6d1c669022..4b741c2aa1 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/69.print +++ b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/69.print @@ -1,11 +1,11 @@ (module (rec (type $f1 (;0;) (sub (func))) - (type (;1;) (struct (field (ref 0)))) + (type (;1;) (struct (field (ref $f1)))) ) (rec (type $f2 (;2;) (sub (func))) - (type (;3;) (struct (field (ref 2)))) + (type (;3;) (struct (field (ref $f2)))) ) (rec (type $g (;4;) (sub $f1 (func))) diff --git a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/7.print b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/7.print index 7c0f5b77f2..ffcbe9c7a8 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/7.print +++ b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/7.print @@ -1,28 +1,28 @@ (module (rec - (type $t1 (;0;) (sub (func (result i32 (ref 1))))) - (type $u1 (;1;) (sub (func (result f32 (ref 0))))) + (type $t1 (;0;) (sub (func (result i32 (ref $u1))))) + (type $u1 (;1;) (sub (func (result f32 (ref $t1))))) ) (rec - (type $t2 (;2;) (sub $t1 (func (result i32 (ref 5))))) - (type $u2 (;3;) (sub $u1 (func (result f32 (ref 4))))) - (type $t3 (;4;) (sub $t1 (func (result i32 (ref 3))))) - (type $u3 (;5;) (sub $u1 (func (result f32 (ref 2))))) + (type $t2 (;2;) (sub $t1 (func (result i32 (ref $u3))))) + (type $u2 (;3;) (sub $u1 (func (result f32 (ref $t3))))) + (type $t3 (;4;) (sub $t1 (func (result i32 (ref $u2))))) + (type $u3 (;5;) (sub $u1 (func (result f32 (ref $t2))))) ) - (type (;6;) (func (param (ref 0)))) - (type (;7;) (func (param (ref 2)))) - (type (;8;) (func (param (ref 4)))) - (func $f1 (;0;) (type 6) (param $r (ref 0)) + (type (;6;) (func (param (ref $t1)))) + (type (;7;) (func (param (ref $t2)))) + (type (;8;) (func (param (ref $t3)))) + (func $f1 (;0;) (type 6) (param $r (ref $t1)) local.get $r call $f1 ) - (func $f2 (;1;) (type 7) (param $r (ref 2)) + (func $f2 (;1;) (type 7) (param $r (ref $t2)) local.get $r call $f1 local.get $r call $f2 ) - (func $f3 (;2;) (type 8) (param $r (ref 4)) + (func $f3 (;2;) (type 8) (param $r (ref $t3)) local.get $r call $f1 local.get $r diff --git a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/70.print b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/70.print index 2dc8745471..678221f7d9 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/70.print +++ b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/70.print @@ -1,15 +1,15 @@ (module (rec (type $f1 (;0;) (sub (func))) - (type $s1 (;1;) (sub (struct (field (ref 0))))) + (type $s1 (;1;) (sub (struct (field (ref $f1))))) ) (rec (type $f2 (;2;) (sub (func))) - (type $s2 (;3;) (sub (struct (field (ref 2))))) + (type $s2 (;3;) (sub (struct (field (ref $f2))))) ) (rec (type $g2 (;4;) (sub $f2 (func))) - (type (;5;) (sub $s2 (struct (field (ref 0)) (field (ref 2)) (field (ref 0)) (field (ref 2)) (field (ref 4))))) + (type (;5;) (sub $s2 (struct (field (ref $f1)) (field (ref $f2)) (field (ref $f1)) (field (ref $f2)) (field (ref $g2))))) ) (rec (type $h (;6;) (sub $g2 (func))) diff --git a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/72.print b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/72.print index 46fcc839de..da941728e4 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/72.print +++ b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/72.print @@ -1,15 +1,15 @@ (module (rec (type $f1 (;0;) (sub (func))) - (type $s1 (;1;) (sub (struct (field (ref 0))))) + (type $s1 (;1;) (sub (struct (field (ref $f1))))) ) (rec (type $f2 (;2;) (sub (func))) - (type $s2 (;3;) (sub (struct (field (ref 2))))) + (type $s2 (;3;) (sub (struct (field (ref $f2))))) ) (rec (type $g1 (;4;) (sub $f1 (func))) - (type (;5;) (sub $s1 (struct (field (ref 0)) (field (ref 0)) (field (ref 2)) (field (ref 2)) (field (ref 4))))) + (type (;5;) (sub $s1 (struct (field (ref $f1)) (field (ref $f1)) (field (ref $f2)) (field (ref $f2)) (field (ref $g1))))) ) (rec (type $h (;6;) (sub $g1 (func))) diff --git a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/73.print b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/73.print index eba797b389..9940d23b0e 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/73.print +++ b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/73.print @@ -1,16 +1,16 @@ (module (rec (type $f11 (;0;) (sub (func (result (ref func))))) - (type $f12 (;1;) (sub $f11 (func (result (ref 0))))) + (type $f12 (;1;) (sub $f11 (func (result (ref $f11))))) ) (rec (type $f21 (;2;) (sub (func (result (ref func))))) - (type $f22 (;3;) (sub $f21 (func (result (ref 2))))) + (type $f22 (;3;) (sub $f21 (func (result (ref $f21))))) ) (func (;0;) (type $f11) (result (ref func)) unreachable ) - (func (;1;) (type $f12) (result (ref 0)) + (func (;1;) (type $f12) (result (ref $f11)) unreachable ) (export "f11" (func 0)) diff --git a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/75.print b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/75.print index f274811014..5b4d259355 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/75.print +++ b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/75.print @@ -1,11 +1,11 @@ (module (rec (type $f11 (;0;) (sub (func (result (ref func))))) - (type $f12 (;1;) (sub $f11 (func (result (ref 0))))) + (type $f12 (;1;) (sub $f11 (func (result (ref $f11))))) ) (rec (type $f21 (;2;) (sub (func (result (ref func))))) - (type $f22 (;3;) (sub $f21 (func (result (ref 2))))) + (type $f22 (;3;) (sub $f21 (func (result (ref $f21))))) ) (import "M8" "f11" (func (;0;) (type $f11))) (import "M8" "f11" (func (;1;) (type $f21))) diff --git a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/76.print b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/76.print index 41499a753f..e46030e6f6 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/76.print +++ b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/76.print @@ -1,24 +1,24 @@ (module (rec (type $f11 (;0;) (sub (func (result (ref func))))) - (type $f12 (;1;) (sub $f11 (func (result (ref 0))))) + (type $f12 (;1;) (sub $f11 (func (result (ref $f11))))) ) (rec (type $f21 (;2;) (sub (func (result (ref func))))) - (type $f22 (;3;) (sub $f21 (func (result (ref 2))))) + (type $f22 (;3;) (sub $f21 (func (result (ref $f21))))) ) (rec (type $g11 (;4;) (sub $f11 (func (result (ref func))))) - (type $g12 (;5;) (sub $g11 (func (result (ref 4))))) + (type $g12 (;5;) (sub $g11 (func (result (ref $g11))))) ) (rec (type $g21 (;6;) (sub $f21 (func (result (ref func))))) - (type $g22 (;7;) (sub $g21 (func (result (ref 6))))) + (type $g22 (;7;) (sub $g21 (func (result (ref $g21))))) ) (func (;0;) (type $g11) (result (ref func)) unreachable ) - (func (;1;) (type $g12) (result (ref 4)) + (func (;1;) (type $g12) (result (ref $g11)) unreachable ) (export "g11" (func 0)) diff --git a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/78.print b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/78.print index 29f91f281f..6aeee7012c 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/78.print +++ b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/78.print @@ -1,19 +1,19 @@ (module (rec (type $f11 (;0;) (sub (func (result (ref func))))) - (type $f12 (;1;) (sub $f11 (func (result (ref 0))))) + (type $f12 (;1;) (sub $f11 (func (result (ref $f11))))) ) (rec (type $f21 (;2;) (sub (func (result (ref func))))) - (type $f22 (;3;) (sub $f21 (func (result (ref 2))))) + (type $f22 (;3;) (sub $f21 (func (result (ref $f21))))) ) (rec (type $g11 (;4;) (sub $f11 (func (result (ref func))))) - (type $g12 (;5;) (sub $g11 (func (result (ref 4))))) + (type $g12 (;5;) (sub $g11 (func (result (ref $g11))))) ) (rec (type $g21 (;6;) (sub $f21 (func (result (ref func))))) - (type $g22 (;7;) (sub $g21 (func (result (ref 6))))) + (type $g22 (;7;) (sub $g21 (func (result (ref $g21))))) ) (import "M9" "g11" (func (;0;) (type $f11))) (import "M9" "g11" (func (;1;) (type $f21))) diff --git a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/8.print b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/8.print index eb9de4aa7a..20d055b5b4 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/8.print +++ b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/8.print @@ -1,11 +1,11 @@ (module (rec (type $f1 (;0;) (sub (func))) - (type (;1;) (struct (field (ref 0)))) + (type (;1;) (struct (field (ref $f1)))) ) (rec (type $f2 (;2;) (sub (func))) - (type (;3;) (struct (field (ref 2)))) + (type (;3;) (struct (field (ref $f2)))) ) (rec (type $g1 (;4;) (sub $f1 (func))) @@ -16,5 +16,5 @@ (type (;7;) (struct)) ) (func $g (;0;) (type $g2)) - (global (;0;) (ref 4) ref.func $g) + (global (;0;) (ref $g1) ref.func $g) ) diff --git a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/9.print b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/9.print index 166dfab192..f8b1d74433 100644 --- a/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/9.print +++ b/tests/snapshots/testsuite/proposals/gc/type-subtyping.wast/9.print @@ -1,20 +1,20 @@ (module (rec (type $f1 (;0;) (sub (func))) - (type $s1 (;1;) (sub (struct (field (ref 0))))) + (type $s1 (;1;) (sub (struct (field (ref $f1))))) ) (rec (type $f2 (;2;) (sub (func))) - (type $s2 (;3;) (sub (struct (field (ref 2))))) + (type $s2 (;3;) (sub (struct (field (ref $f2))))) ) (rec (type $g1 (;4;) (sub $f1 (func))) - (type (;5;) (sub $s1 (struct (field (ref 0)) (field (ref 0)) (field (ref 2)) (field (ref 2)) (field (ref 4))))) + (type (;5;) (sub $s1 (struct (field (ref $f1)) (field (ref $f1)) (field (ref $f2)) (field (ref $f2)) (field (ref $g1))))) ) (rec (type $g2 (;6;) (sub $f2 (func))) - (type (;7;) (sub $s2 (struct (field (ref 0)) (field (ref 2)) (field (ref 0)) (field (ref 2)) (field (ref 6))))) + (type (;7;) (sub $s2 (struct (field (ref $f1)) (field (ref $f2)) (field (ref $f1)) (field (ref $f2)) (field (ref $g2))))) ) (func $g (;0;) (type $g2)) - (global (;0;) (ref 4) ref.func $g) + (global (;0;) (ref $g1) ref.func $g) )