diff --git a/toolchain/check/context.cpp b/toolchain/check/context.cpp index a4dbb92c8555..546252b6b99f 100644 --- a/toolchain/check/context.cpp +++ b/toolchain/check/context.cpp @@ -318,8 +318,6 @@ auto Context::Initialize(Parse::Node parse_node, SemIR::NodeId target_id, return expr_id; case SemIR::ExpressionCategory::Mixed: - // Strip off outer stub references. - expr_id = SkipStubReferences(expr_id); expr = semantics_ir().GetNode(expr_id); // TODO: Make non-recursive. @@ -445,8 +443,6 @@ auto Context::ConvertToValueExpression(SemIR::NodeId expr_id) -> SemIR::NodeId { return expr_id; case SemIR::ExpressionCategory::Mixed: { - // Strip off outer stub references. - expr_id = SkipStubReferences(expr_id); SemIR::Node expr = semantics_ir().GetNode(expr_id); // TODO: Make non-recursive. @@ -499,7 +495,6 @@ auto Context::ConvertToValueOrReferenceExpression(SemIR::NodeId expr_id, auto Context::MarkInitializerFor(SemIR::NodeId init_id, SemIR::NodeId target_id) -> void { - init_id = SkipStubReferences(init_id); SemIR::Node init = semantics_ir().GetNode(init_id); CARBON_CHECK(SemIR::GetExpressionCategory(semantics_ir(), init_id) == SemIR::ExpressionCategory::Initializing) @@ -556,7 +551,6 @@ auto Context::MarkInitializerFor(SemIR::NodeId init_id, SemIR::NodeId target_id) auto Context::FinalizeTemporary(SemIR::NodeId init_id, bool discarded) -> SemIR::NodeId { - init_id = SkipStubReferences(init_id); SemIR::Node init = semantics_ir().GetNode(init_id); CARBON_CHECK(SemIR::GetExpressionCategory(semantics_ir(), init_id) == SemIR::ExpressionCategory::Initializing) @@ -703,9 +697,6 @@ static auto ConvertTupleToArray(Context& context, SemIR::Node tuple_type, const auto& tuple_elem_types = context.semantics_ir().GetTypeBlock(tuple_elem_types_id); - // Skip back over StubReferences to find if we're being initialized from a - // tuple literal. - value_id = context.SkipStubReferences(value_id); auto value = context.semantics_ir().GetNode(value_id); llvm::ArrayRef literal_elems; @@ -861,14 +852,13 @@ auto Context::ImplicitAs(Parse::Node parse_node, SemIR::NodeId value_id, auto Context::ParamOrArgStart() -> void { params_or_args_stack_.Push(); } -auto Context::ParamOrArgComma(bool for_args) -> void { - ParamOrArgSave(for_args); +auto Context::ParamOrArgComma() -> void { + ParamOrArgSave(node_stack_.PopExpression()); } -auto Context::ParamOrArgEndNoPop(bool for_args, Parse::NodeKind start_kind) - -> void { +auto Context::ParamOrArgEndNoPop(Parse::NodeKind start_kind) -> void { if (parse_tree_->node_kind(node_stack_.PeekParseNode()) != start_kind) { - ParamOrArgSave(for_args); + ParamOrArgSave(node_stack_.PopExpression()); } } @@ -876,27 +866,11 @@ auto Context::ParamOrArgPop() -> SemIR::NodeBlockId { return params_or_args_stack_.Pop(); } -auto Context::ParamOrArgEnd(bool for_args, Parse::NodeKind start_kind) - -> SemIR::NodeBlockId { - ParamOrArgEndNoPop(for_args, start_kind); +auto Context::ParamOrArgEnd(Parse::NodeKind start_kind) -> SemIR::NodeBlockId { + ParamOrArgEndNoPop(start_kind); return ParamOrArgPop(); } -auto Context::ParamOrArgSave(bool for_args) -> void { - auto [entry_parse_node, entry_node_id] = - node_stack_.PopExpressionWithParseNode(); - if (for_args) { - // For an argument, we add a stub reference to the expression on the top of - // the stack. There may not be anything on the IR prior to this. - entry_node_id = AddNode(SemIR::Node::StubReference::Make( - entry_parse_node, semantics_ir_->GetNode(entry_node_id).type_id(), - entry_node_id)); - } - - // Save the param or arg ID. - params_or_args_stack_.AddNodeId(entry_node_id); -} - auto Context::CanonicalizeTypeImpl( SemIR::NodeKind kind, llvm::function_ref profile_type, @@ -979,16 +953,6 @@ static auto ProfileType(Context& semantics_context, SemIR::Node node, } break; } - case SemIR::NodeKind::StubReference: { - // We rely on stub references not referring to each other to ensure we - // only recurse once here. - auto inner = - semantics_context.semantics_ir().GetNode(node.GetAsStubReference()); - CARBON_CHECK(inner.kind() != SemIR::NodeKind::StubReference) - << "A stub reference should never refer to another stub reference."; - ProfileType(semantics_context, inner, canonical_id); - break; - } case SemIR::NodeKind::TupleType: ProfileTupleType( semantics_context.semantics_ir().GetTypeBlock(node.GetAsTupleType()), diff --git a/toolchain/check/context.h b/toolchain/check/context.h index 96ce35789e77..1549045a531a 100644 --- a/toolchain/check/context.h +++ b/toolchain/check/context.h @@ -105,17 +105,6 @@ class Context { // Returns whether the current position in the current block is reachable. auto is_current_position_reachable() -> bool; - // Skips past any stub references to find the node that defines the value of - // the given node. - auto SkipStubReferences(SemIR::NodeId expr_id) -> SemIR::NodeId { - SemIR::Node expr = semantics_ir().GetNode(expr_id); - while (expr.kind() == SemIR::NodeKind::StubReference) { - expr_id = expr.GetAsStubReference(); - expr = semantics_ir().GetNode(expr_id); - } - return expr_id; - } - // Convert the given expression to a value expression of the same type. auto ConvertToValueExpression(SemIR::NodeId expr_id) -> SemIR::NodeId; @@ -211,14 +200,14 @@ class Context { // On a comma, pushes the entry. On return, the top of node_stack_ will be // start_kind. - auto ParamOrArgComma(bool for_args) -> void; + auto ParamOrArgComma() -> void; // Detects whether there's an entry to push from the end of a parameter or // argument list, and if so, moves it to the current parameter or argument // list. Does not pop the list. `start_kind` is the node kind at the start // of the parameter or argument list, and will be at the top of the parse node // stack when this function returns. - auto ParamOrArgEndNoPop(bool for_args, Parse::NodeKind start_kind) -> void; + auto ParamOrArgEndNoPop(Parse::NodeKind start_kind) -> void; // Pops the current parameter or argument list. Should only be called after // `ParamOrArgEndNoPop`. @@ -226,15 +215,13 @@ class Context { // Detects whether there's an entry to push. Pops and returns the argument // list. This is the same as `ParamOrArgEndNoPop` followed by `ParamOrArgPop`. - auto ParamOrArgEnd(bool for_args, Parse::NodeKind start_kind) - -> SemIR::NodeBlockId; + auto ParamOrArgEnd(Parse::NodeKind start_kind) -> SemIR::NodeBlockId; // Saves a parameter from the top block in node_stack_ to the top block in - // params_or_args_stack_. If for_args, adds a StubReference of the previous - // node's result to the IR. - // - // This should only be called by other ParamOrArg functions, not directly. - auto ParamOrArgSave(bool for_args) -> void; + // params_or_args_stack_. + auto ParamOrArgSave(SemIR::NodeId node_id) -> void { + params_or_args_stack_.AddNodeId(node_id); + } // Prints information for a stack dump. auto PrintForStackDump(llvm::raw_ostream& output) const -> void; diff --git a/toolchain/check/handle_call_expression.cpp b/toolchain/check/handle_call_expression.cpp index db4774c2e78e..c00d7a329bc5 100644 --- a/toolchain/check/handle_call_expression.cpp +++ b/toolchain/check/handle_call_expression.cpp @@ -10,8 +10,7 @@ namespace Carbon::Check { auto HandleCallExpression(Context& context, Parse::Node parse_node) -> bool { // Process the final explicit call argument, but leave the arguments block on // the stack until we add the return slot argument. - context.ParamOrArgEndNoPop( - /*for_args=*/true, Parse::NodeKind::CallExpressionStart); + context.ParamOrArgEndNoPop(Parse::NodeKind::CallExpressionStart); // TODO: Convert to call expression. auto [call_expr_parse_node, name_id] = @@ -40,13 +39,9 @@ auto HandleCallExpression(Context& context, Parse::Node parse_node) -> bool { if (callable.return_slot_id.is_valid()) { // Tentatively put storage for a temporary in the function's return slot. // This will be replaced if necessary when we perform initialization. - context.AddNodeAndPush(parse_node, - SemIR::Node::TemporaryStorage::Make( - call_expr_parse_node, callable.return_type_id)); - // TODO: We pass for_args=false here because we don't want a StubReference. - // We should remove the StubReferences for arguments and the corresponding - // `for_args` parameter. They didn't turn out to be used for anything. - context.ParamOrArgSave(/*for_args=*/false); + auto temp_id = context.AddNode(SemIR::Node::TemporaryStorage::Make( + call_expr_parse_node, callable.return_type_id)); + context.ParamOrArgSave(temp_id); } // Convert the arguments to match the parameters. @@ -67,7 +62,7 @@ auto HandleCallExpression(Context& context, Parse::Node parse_node) -> bool { auto HandleCallExpressionComma(Context& context, Parse::Node /*parse_node*/) -> bool { - context.ParamOrArgComma(/*for_args=*/true); + context.ParamOrArgComma(); return true; } diff --git a/toolchain/check/handle_parameter_list.cpp b/toolchain/check/handle_parameter_list.cpp index a1255b7f16ac..100364a5543d 100644 --- a/toolchain/check/handle_parameter_list.cpp +++ b/toolchain/check/handle_parameter_list.cpp @@ -17,8 +17,7 @@ auto HandleDeducedParameterListStart(Context& context, Parse::Node parse_node) } auto HandleParameterList(Context& context, Parse::Node parse_node) -> bool { - auto refs_id = context.ParamOrArgEnd( - /*for_args=*/false, Parse::NodeKind::ParameterListStart); + auto refs_id = context.ParamOrArgEnd(Parse::NodeKind::ParameterListStart); context.PopScope(); context.node_stack() .PopAndDiscardSoloParseNode(); @@ -28,7 +27,7 @@ auto HandleParameterList(Context& context, Parse::Node parse_node) -> bool { auto HandleParameterListComma(Context& context, Parse::Node /*parse_node*/) -> bool { - context.ParamOrArgComma(/*for_args=*/false); + context.ParamOrArgComma(); return true; } diff --git a/toolchain/check/handle_paren.cpp b/toolchain/check/handle_paren.cpp index 27bd121ea5e1..ce61d277c703 100644 --- a/toolchain/check/handle_paren.cpp +++ b/toolchain/check/handle_paren.cpp @@ -12,8 +12,7 @@ auto HandleParenExpression(Context& context, Parse::Node parse_node) -> bool { auto value_id = context.node_stack().PopExpression(); // ParamOrArgStart was called for tuple handling; clean up the ParamOrArg // support for non-tuple cases. - context.ParamOrArgEnd( - /*for_args=*/true, Parse::NodeKind::ParenExpressionOrTupleLiteralStart); + context.ParamOrArgEnd(Parse::NodeKind::ParenExpressionOrTupleLiteralStart); context.node_stack() .PopAndDiscardSoloParseNode< Parse::NodeKind::ParenExpressionOrTupleLiteralStart>(); @@ -30,13 +29,13 @@ auto HandleParenExpressionOrTupleLiteralStart(Context& context, auto HandleTupleLiteralComma(Context& context, Parse::Node /*parse_node*/) -> bool { - context.ParamOrArgComma(/*for_args=*/true); + context.ParamOrArgComma(); return true; } auto HandleTupleLiteral(Context& context, Parse::Node parse_node) -> bool { auto refs_id = context.ParamOrArgEnd( - /*for_args=*/true, Parse::NodeKind::ParenExpressionOrTupleLiteralStart); + Parse::NodeKind::ParenExpressionOrTupleLiteralStart); context.node_stack() .PopAndDiscardSoloParseNode< diff --git a/toolchain/check/handle_struct.cpp b/toolchain/check/handle_struct.cpp index ddad1b61695a..96630821dc36 100644 --- a/toolchain/check/handle_struct.cpp +++ b/toolchain/check/handle_struct.cpp @@ -7,10 +7,7 @@ namespace Carbon::Check { auto HandleStructComma(Context& context, Parse::Node /*parse_node*/) -> bool { - context.ParamOrArgComma( - /*for_args=*/context.parse_tree().node_kind( - context.node_stack().PeekParseNode()) != - Parse::NodeKind::StructFieldType); + context.ParamOrArgComma(); return true; } @@ -57,7 +54,6 @@ auto HandleStructFieldValue(Context& context, Parse::Node parse_node) -> bool { auto HandleStructLiteral(Context& context, Parse::Node parse_node) -> bool { auto refs_id = context.ParamOrArgEnd( - /*for_args=*/true, Parse::NodeKind::StructLiteralOrStructTypeLiteralStart); context.PopScope(); @@ -89,7 +85,6 @@ auto HandleStructLiteralOrStructTypeLiteralStart(Context& context, auto HandleStructTypeLiteral(Context& context, Parse::Node parse_node) -> bool { auto refs_id = context.ParamOrArgEnd( - /*for_args=*/false, Parse::NodeKind::StructLiteralOrStructTypeLiteralStart); context.PopScope(); diff --git a/toolchain/check/testdata/array/assign_return_value.carbon b/toolchain/check/testdata/array/assign_return_value.carbon index b456b0641c45..1445c0b267a0 100644 --- a/toolchain/check/testdata/array/assign_return_value.carbon +++ b/toolchain/check/testdata/array/assign_return_value.carbon @@ -17,10 +17,9 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> (i32,) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc7_28.1: i32 = int_literal 0 -// CHECK:STDOUT: %.loc7_28.2: i32 = stub_reference %.loc7_28.1 -// CHECK:STDOUT: %.loc7_30.1: (i32,) = tuple_literal (%.loc7_28.2) -// CHECK:STDOUT: %.loc7_30.2: (i32,) = tuple_value %.loc7_30.1, (%.loc7_28.2) +// CHECK:STDOUT: %.loc7_28: i32 = int_literal 0 +// CHECK:STDOUT: %.loc7_30.1: (i32,) = tuple_literal (%.loc7_28) +// CHECK:STDOUT: %.loc7_30.2: (i32,) = tuple_value %.loc7_30.1, (%.loc7_28) // CHECK:STDOUT: return %.loc7_30.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/array/assign_var.carbon b/toolchain/check/testdata/array/assign_var.carbon index b0e6ec90eb59..a29fb04f94a6 100644 --- a/toolchain/check/testdata/array/assign_var.carbon +++ b/toolchain/check/testdata/array/assign_var.carbon @@ -8,29 +8,23 @@ var a: (i32, i32, i32) = (1, 2, 3); var b: [i32; 3] = a; // CHECK:STDOUT: file "assign_var.carbon" { -// CHECK:STDOUT: %.loc7_9: type = stub_reference i32 -// CHECK:STDOUT: %.loc7_14: type = stub_reference i32 -// CHECK:STDOUT: %.loc7_19: type = stub_reference i32 // CHECK:STDOUT: %.loc7_22.1: type = tuple_type (type, type, type) -// CHECK:STDOUT: %.loc7_22.2: (type, type, type) = tuple_literal (%.loc7_9, %.loc7_14, %.loc7_19) +// CHECK:STDOUT: %.loc7_22.2: (type, type, type) = tuple_literal (i32, i32, i32) // CHECK:STDOUT: %.loc7_22.3: type = tuple_type (i32, i32, i32) // CHECK:STDOUT: %a: ref (i32, i32, i32) = var "a" -// CHECK:STDOUT: %.loc7_27.1: i32 = int_literal 1 -// CHECK:STDOUT: %.loc7_27.2: i32 = stub_reference %.loc7_27.1 -// CHECK:STDOUT: %.loc7_30.1: i32 = int_literal 2 -// CHECK:STDOUT: %.loc7_30.2: i32 = stub_reference %.loc7_30.1 -// CHECK:STDOUT: %.loc7_33.1: i32 = int_literal 3 -// CHECK:STDOUT: %.loc7_33.2: i32 = stub_reference %.loc7_33.1 -// CHECK:STDOUT: %.loc7_34: (i32, i32, i32) = tuple_literal (%.loc7_27.2, %.loc7_30.2, %.loc7_33.2) +// CHECK:STDOUT: %.loc7_27: i32 = int_literal 1 +// CHECK:STDOUT: %.loc7_30: i32 = int_literal 2 +// CHECK:STDOUT: %.loc7_33: i32 = int_literal 3 +// CHECK:STDOUT: %.loc7_34: (i32, i32, i32) = tuple_literal (%.loc7_27, %.loc7_30, %.loc7_33) // CHECK:STDOUT: %.loc7_35.1: i32 = int_literal 0 // CHECK:STDOUT: %.loc7_35.2: ref i32 = tuple_index %a, %.loc7_35.1 -// CHECK:STDOUT: %.loc7_35.3: init i32 = initialize_from %.loc7_27.2 to %.loc7_35.2 +// CHECK:STDOUT: %.loc7_35.3: init i32 = initialize_from %.loc7_27 to %.loc7_35.2 // CHECK:STDOUT: %.loc7_35.4: i32 = int_literal 1 // CHECK:STDOUT: %.loc7_35.5: ref i32 = tuple_index %a, %.loc7_35.4 -// CHECK:STDOUT: %.loc7_35.6: init i32 = initialize_from %.loc7_30.2 to %.loc7_35.5 +// CHECK:STDOUT: %.loc7_35.6: init i32 = initialize_from %.loc7_30 to %.loc7_35.5 // CHECK:STDOUT: %.loc7_35.7: i32 = int_literal 2 // CHECK:STDOUT: %.loc7_35.8: ref i32 = tuple_index %a, %.loc7_35.7 -// CHECK:STDOUT: %.loc7_35.9: init i32 = initialize_from %.loc7_33.2 to %.loc7_35.8 +// CHECK:STDOUT: %.loc7_35.9: init i32 = initialize_from %.loc7_33 to %.loc7_35.8 // CHECK:STDOUT: %.loc7_35.10: init (i32, i32, i32) = tuple_init %.loc7_34, (%.loc7_35.3, %.loc7_35.6, %.loc7_35.9) // CHECK:STDOUT: assign %a, %.loc7_35.10 // CHECK:STDOUT: %.loc8_14: i32 = int_literal 3 diff --git a/toolchain/check/testdata/array/base.carbon b/toolchain/check/testdata/array/base.carbon index 201c4085062c..4d3de21ed0e6 100644 --- a/toolchain/check/testdata/array/base.carbon +++ b/toolchain/check/testdata/array/base.carbon @@ -12,32 +12,29 @@ var c: [(); 5] = ((), (), (), (), (),); // CHECK:STDOUT: %.loc7_14: i32 = int_literal 1 // CHECK:STDOUT: %.loc7_15: type = array_type %.loc7_14, i32 // CHECK:STDOUT: %a: ref [i32; 1] = var "a" -// CHECK:STDOUT: %.loc7_20.1: i32 = int_literal 1 -// CHECK:STDOUT: %.loc7_20.2: i32 = stub_reference %.loc7_20.1 +// CHECK:STDOUT: %.loc7_20: i32 = int_literal 1 // CHECK:STDOUT: %.loc7_22.1: type = tuple_type (i32) -// CHECK:STDOUT: %.loc7_22.2: (i32,) = tuple_literal (%.loc7_20.2) +// CHECK:STDOUT: %.loc7_22.2: (i32,) = tuple_literal (%.loc7_20) // CHECK:STDOUT: %.loc7_22.3: ref [i32; 1] = stub_reference %a // CHECK:STDOUT: %.loc7_22.4: i32 = int_literal 0 // CHECK:STDOUT: %.loc7_22.5: ref i32 = array_index %.loc7_22.3, %.loc7_22.4 -// CHECK:STDOUT: %.loc7_22.6: init i32 = initialize_from %.loc7_20.2 to %.loc7_22.5 +// CHECK:STDOUT: %.loc7_22.6: init i32 = initialize_from %.loc7_20 to %.loc7_22.5 // CHECK:STDOUT: %.loc7_22.7: init [i32; 1] = array_init %.loc7_22.2, (%.loc7_22.6) to %.loc7_22.3 // CHECK:STDOUT: assign %a, %.loc7_22.7 // CHECK:STDOUT: %.loc8_14: i32 = int_literal 2 // CHECK:STDOUT: %.loc8_15: type = array_type %.loc8_14, f64 // CHECK:STDOUT: %b: ref [f64; 2] = var "b" -// CHECK:STDOUT: %.loc8_20.1: f64 = real_literal 111e-1 -// CHECK:STDOUT: %.loc8_20.2: f64 = stub_reference %.loc8_20.1 -// CHECK:STDOUT: %.loc8_26.1: f64 = real_literal 22e-1 -// CHECK:STDOUT: %.loc8_26.2: f64 = stub_reference %.loc8_26.1 +// CHECK:STDOUT: %.loc8_20: f64 = real_literal 111e-1 +// CHECK:STDOUT: %.loc8_26: f64 = real_literal 22e-1 // CHECK:STDOUT: %.loc8_30.1: type = tuple_type (f64, f64) -// CHECK:STDOUT: %.loc8_30.2: (f64, f64) = tuple_literal (%.loc8_20.2, %.loc8_26.2) +// CHECK:STDOUT: %.loc8_30.2: (f64, f64) = tuple_literal (%.loc8_20, %.loc8_26) // CHECK:STDOUT: %.loc8_30.3: ref [f64; 2] = stub_reference %b // CHECK:STDOUT: %.loc8_30.4: i32 = int_literal 0 // CHECK:STDOUT: %.loc8_30.5: ref f64 = array_index %.loc8_30.3, %.loc8_30.4 -// CHECK:STDOUT: %.loc8_30.6: init f64 = initialize_from %.loc8_20.2 to %.loc8_30.5 +// CHECK:STDOUT: %.loc8_30.6: init f64 = initialize_from %.loc8_20 to %.loc8_30.5 // CHECK:STDOUT: %.loc8_30.7: i32 = int_literal 1 // CHECK:STDOUT: %.loc8_30.8: ref f64 = array_index %.loc8_30.3, %.loc8_30.7 -// CHECK:STDOUT: %.loc8_30.9: init f64 = initialize_from %.loc8_26.2 to %.loc8_30.8 +// CHECK:STDOUT: %.loc8_30.9: init f64 = initialize_from %.loc8_26 to %.loc8_30.8 // CHECK:STDOUT: %.loc8_30.10: init [f64; 2] = array_init %.loc8_30.2, (%.loc8_30.6, %.loc8_30.9) to %.loc8_30.3 // CHECK:STDOUT: assign %b, %.loc8_30.10 // CHECK:STDOUT: %.loc9_10.1: type = tuple_type () @@ -45,34 +42,29 @@ var c: [(); 5] = ((), (), (), (), (),); // CHECK:STDOUT: %.loc9_13: i32 = int_literal 5 // CHECK:STDOUT: %.loc9_14: type = array_type %.loc9_13, () // CHECK:STDOUT: %c: ref [(); 5] = var "c" -// CHECK:STDOUT: %.loc9_20.1: () = tuple_literal () -// CHECK:STDOUT: %.loc9_20.2: () = stub_reference %.loc9_20.1 -// CHECK:STDOUT: %.loc9_24.1: () = tuple_literal () -// CHECK:STDOUT: %.loc9_24.2: () = stub_reference %.loc9_24.1 -// CHECK:STDOUT: %.loc9_28.1: () = tuple_literal () -// CHECK:STDOUT: %.loc9_28.2: () = stub_reference %.loc9_28.1 -// CHECK:STDOUT: %.loc9_32.1: () = tuple_literal () -// CHECK:STDOUT: %.loc9_32.2: () = stub_reference %.loc9_32.1 -// CHECK:STDOUT: %.loc9_36.1: () = tuple_literal () -// CHECK:STDOUT: %.loc9_36.2: () = stub_reference %.loc9_36.1 +// CHECK:STDOUT: %.loc9_20: () = tuple_literal () +// CHECK:STDOUT: %.loc9_24: () = tuple_literal () +// CHECK:STDOUT: %.loc9_28: () = tuple_literal () +// CHECK:STDOUT: %.loc9_32: () = tuple_literal () +// CHECK:STDOUT: %.loc9_36: () = tuple_literal () // CHECK:STDOUT: %.loc9_38.1: type = tuple_type ((), (), (), (), ()) -// CHECK:STDOUT: %.loc9_38.2: ((), (), (), (), ()) = tuple_literal (%.loc9_20.2, %.loc9_24.2, %.loc9_28.2, %.loc9_32.2, %.loc9_36.2) +// CHECK:STDOUT: %.loc9_38.2: ((), (), (), (), ()) = tuple_literal (%.loc9_20, %.loc9_24, %.loc9_28, %.loc9_32, %.loc9_36) // CHECK:STDOUT: %.loc9_38.3: ref [(); 5] = stub_reference %c // CHECK:STDOUT: %.loc9_38.4: i32 = int_literal 0 // CHECK:STDOUT: %.loc9_38.5: ref () = array_index %.loc9_38.3, %.loc9_38.4 -// CHECK:STDOUT: %.loc9_38.6: init () = tuple_init %.loc9_20.1, () +// CHECK:STDOUT: %.loc9_38.6: init () = tuple_init %.loc9_20, () // CHECK:STDOUT: %.loc9_38.7: i32 = int_literal 1 // CHECK:STDOUT: %.loc9_38.8: ref () = array_index %.loc9_38.3, %.loc9_38.7 -// CHECK:STDOUT: %.loc9_38.9: init () = tuple_init %.loc9_24.1, () +// CHECK:STDOUT: %.loc9_38.9: init () = tuple_init %.loc9_24, () // CHECK:STDOUT: %.loc9_38.10: i32 = int_literal 2 // CHECK:STDOUT: %.loc9_38.11: ref () = array_index %.loc9_38.3, %.loc9_38.10 -// CHECK:STDOUT: %.loc9_38.12: init () = tuple_init %.loc9_28.1, () +// CHECK:STDOUT: %.loc9_38.12: init () = tuple_init %.loc9_28, () // CHECK:STDOUT: %.loc9_38.13: i32 = int_literal 3 // CHECK:STDOUT: %.loc9_38.14: ref () = array_index %.loc9_38.3, %.loc9_38.13 -// CHECK:STDOUT: %.loc9_38.15: init () = tuple_init %.loc9_32.1, () +// CHECK:STDOUT: %.loc9_38.15: init () = tuple_init %.loc9_32, () // CHECK:STDOUT: %.loc9_38.16: i32 = int_literal 4 // CHECK:STDOUT: %.loc9_38.17: ref () = array_index %.loc9_38.3, %.loc9_38.16 -// CHECK:STDOUT: %.loc9_38.18: init () = tuple_init %.loc9_36.1, () +// CHECK:STDOUT: %.loc9_38.18: init () = tuple_init %.loc9_36, () // CHECK:STDOUT: %.loc9_38.19: init [(); 5] = array_init %.loc9_38.2, (%.loc9_38.6, %.loc9_38.9, %.loc9_38.12, %.loc9_38.15, %.loc9_38.18) to %.loc9_38.3 // CHECK:STDOUT: assign %c, %.loc9_38.19 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/array/fail_out_of_bound.carbon b/toolchain/check/testdata/array/fail_out_of_bound.carbon index 701b32b712c4..f73c383a9c4c 100644 --- a/toolchain/check/testdata/array/fail_out_of_bound.carbon +++ b/toolchain/check/testdata/array/fail_out_of_bound.carbon @@ -13,13 +13,10 @@ var a: [i32; 1] = (1, 2, 3); // CHECK:STDOUT: %.loc10_14: i32 = int_literal 1 // CHECK:STDOUT: %.loc10_15: type = array_type %.loc10_14, i32 // CHECK:STDOUT: %a: ref [i32; 1] = var "a" -// CHECK:STDOUT: %.loc10_20.1: i32 = int_literal 1 -// CHECK:STDOUT: %.loc10_20.2: i32 = stub_reference %.loc10_20.1 -// CHECK:STDOUT: %.loc10_23.1: i32 = int_literal 2 -// CHECK:STDOUT: %.loc10_23.2: i32 = stub_reference %.loc10_23.1 -// CHECK:STDOUT: %.loc10_26.1: i32 = int_literal 3 -// CHECK:STDOUT: %.loc10_26.2: i32 = stub_reference %.loc10_26.1 +// CHECK:STDOUT: %.loc10_20: i32 = int_literal 1 +// CHECK:STDOUT: %.loc10_23: i32 = int_literal 2 +// CHECK:STDOUT: %.loc10_26: i32 = int_literal 3 // CHECK:STDOUT: %.loc10_27.1: type = tuple_type (i32, i32, i32) -// CHECK:STDOUT: %.loc10_27.2: (i32, i32, i32) = tuple_literal (%.loc10_20.2, %.loc10_23.2, %.loc10_26.2) +// CHECK:STDOUT: %.loc10_27.2: (i32, i32, i32) = tuple_literal (%.loc10_20, %.loc10_23, %.loc10_26) // CHECK:STDOUT: assign %a, // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/array/fail_type_mismatch.carbon b/toolchain/check/testdata/array/fail_type_mismatch.carbon index b76ab6c6a59e..d4efbf691511 100644 --- a/toolchain/check/testdata/array/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/array/fail_type_mismatch.carbon @@ -30,26 +30,20 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: %.loc10_14: i32 = int_literal 3 // CHECK:STDOUT: %.loc10_15: type = array_type %.loc10_14, i32 // CHECK:STDOUT: %a: ref [i32; 3] = var "a" -// CHECK:STDOUT: %.loc10_20.1: i32 = int_literal 1 -// CHECK:STDOUT: %.loc10_20.2: i32 = stub_reference %.loc10_20.1 -// CHECK:STDOUT: %.loc10_23.1: String = string_literal "Hello" -// CHECK:STDOUT: %.loc10_23.2: String = stub_reference %.loc10_23.1 -// CHECK:STDOUT: %.loc10_32.1: String = string_literal "World" -// CHECK:STDOUT: %.loc10_32.2: String = stub_reference %.loc10_32.1 +// CHECK:STDOUT: %.loc10_20: i32 = int_literal 1 +// CHECK:STDOUT: %.loc10_23: String = string_literal "Hello" +// CHECK:STDOUT: %.loc10_32: String = string_literal "World" // CHECK:STDOUT: %.loc10_39.1: type = tuple_type (i32, String, String) -// CHECK:STDOUT: %.loc10_39.2: (i32, String, String) = tuple_literal (%.loc10_20.2, %.loc10_23.2, %.loc10_32.2) +// CHECK:STDOUT: %.loc10_39.2: (i32, String, String) = tuple_literal (%.loc10_20, %.loc10_23, %.loc10_32) // CHECK:STDOUT: %.loc10_39.3: ref [i32; 3] = temporary_storage // CHECK:STDOUT: %.loc10_39.4: i32 = int_literal 0 // CHECK:STDOUT: %.loc10_39.5: ref i32 = array_index %.loc10_39.3, %.loc10_39.4 -// CHECK:STDOUT: %.loc10_39.6: init i32 = initialize_from %.loc10_20.2 to %.loc10_39.5 +// CHECK:STDOUT: %.loc10_39.6: init i32 = initialize_from %.loc10_20 to %.loc10_39.5 // CHECK:STDOUT: %.loc10_39.7: i32 = int_literal 1 // CHECK:STDOUT: %.loc10_39.8: ref i32 = array_index %.loc10_39.3, %.loc10_39.7 // CHECK:STDOUT: assign %a, -// CHECK:STDOUT: %.loc15_10: type = stub_reference i32 -// CHECK:STDOUT: %.loc15_15: type = stub_reference String -// CHECK:STDOUT: %.loc15_23: type = stub_reference String // CHECK:STDOUT: %.loc15_29.1: type = tuple_type (type, type, type) -// CHECK:STDOUT: %.loc15_29.2: (type, type, type) = tuple_literal (%.loc15_10, %.loc15_15, %.loc15_23) +// CHECK:STDOUT: %.loc15_29.2: (type, type, type) = tuple_literal (i32, String, String) // CHECK:STDOUT: %t1: ref (i32, String, String) = var "t1" // CHECK:STDOUT: %.loc16_14: i32 = int_literal 3 // CHECK:STDOUT: %.loc16_15: type = array_type %.loc16_14, i32 @@ -67,17 +61,13 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: %.loc21_14: i32 = int_literal 3 // CHECK:STDOUT: %.loc21_15: type = array_type %.loc21_14, i32 // CHECK:STDOUT: %c: ref [i32; 3] = var "c" -// CHECK:STDOUT: %.loc21_20.1: i32 = int_literal 1 -// CHECK:STDOUT: %.loc21_20.2: i32 = stub_reference %.loc21_20.1 -// CHECK:STDOUT: %.loc21_23.1: i32 = int_literal 2 -// CHECK:STDOUT: %.loc21_23.2: i32 = stub_reference %.loc21_23.1 +// CHECK:STDOUT: %.loc21_20: i32 = int_literal 1 +// CHECK:STDOUT: %.loc21_23: i32 = int_literal 2 // CHECK:STDOUT: %.loc21_24.1: type = tuple_type (i32, i32) -// CHECK:STDOUT: %.loc21_24.2: (i32, i32) = tuple_literal (%.loc21_20.2, %.loc21_23.2) +// CHECK:STDOUT: %.loc21_24.2: (i32, i32) = tuple_literal (%.loc21_20, %.loc21_23) // CHECK:STDOUT: assign %c, -// CHECK:STDOUT: %.loc26_10: type = stub_reference i32 -// CHECK:STDOUT: %.loc26_15: type = stub_reference i32 // CHECK:STDOUT: %.loc26_18.1: type = tuple_type (type, type) -// CHECK:STDOUT: %.loc26_18.2: (type, type) = tuple_literal (%.loc26_10, %.loc26_15) +// CHECK:STDOUT: %.loc26_18.2: (type, type) = tuple_literal (i32, i32) // CHECK:STDOUT: %t2: ref (i32, i32) = var "t2" // CHECK:STDOUT: %.loc27_14: i32 = int_literal 3 // CHECK:STDOUT: %.loc27_15: type = array_type %.loc27_14, i32 diff --git a/toolchain/check/testdata/array/function_param.carbon b/toolchain/check/testdata/array/function_param.carbon index f88dfdea8091..7b45de272b63 100644 --- a/toolchain/check/testdata/array/function_param.carbon +++ b/toolchain/check/testdata/array/function_param.carbon @@ -25,31 +25,26 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @G() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc12_13.1: i32 = int_literal 1 -// CHECK:STDOUT: %.loc12_13.2: i32 = stub_reference %.loc12_13.1 -// CHECK:STDOUT: %.loc12_16.1: i32 = int_literal 2 -// CHECK:STDOUT: %.loc12_16.2: i32 = stub_reference %.loc12_16.1 -// CHECK:STDOUT: %.loc12_19.1: i32 = int_literal 3 -// CHECK:STDOUT: %.loc12_19.2: i32 = stub_reference %.loc12_19.1 +// CHECK:STDOUT: %.loc12_13: i32 = int_literal 1 +// CHECK:STDOUT: %.loc12_16: i32 = int_literal 2 +// CHECK:STDOUT: %.loc12_19: i32 = int_literal 3 // CHECK:STDOUT: %.loc12_20.1: type = tuple_type (i32, i32, i32) -// CHECK:STDOUT: %.loc12_20.2: (i32, i32, i32) = tuple_literal (%.loc12_13.2, %.loc12_16.2, %.loc12_19.2) -// CHECK:STDOUT: %.loc12_20.3: (i32, i32, i32) = stub_reference %.loc12_20.2 -// CHECK:STDOUT: %.loc12_23.1: i32 = int_literal 1 -// CHECK:STDOUT: %.loc12_23.2: i32 = stub_reference %.loc12_23.1 -// CHECK:STDOUT: %.loc12_20.4: ref [i32; 3] = temporary_storage -// CHECK:STDOUT: %.loc12_20.5: i32 = int_literal 0 -// CHECK:STDOUT: %.loc12_20.6: ref i32 = array_index %.loc12_20.4, %.loc12_20.5 -// CHECK:STDOUT: %.loc12_20.7: init i32 = initialize_from %.loc12_13.2 to %.loc12_20.6 -// CHECK:STDOUT: %.loc12_20.8: i32 = int_literal 1 -// CHECK:STDOUT: %.loc12_20.9: ref i32 = array_index %.loc12_20.4, %.loc12_20.8 -// CHECK:STDOUT: %.loc12_20.10: init i32 = initialize_from %.loc12_16.2 to %.loc12_20.9 -// CHECK:STDOUT: %.loc12_20.11: i32 = int_literal 2 -// CHECK:STDOUT: %.loc12_20.12: ref i32 = array_index %.loc12_20.4, %.loc12_20.11 -// CHECK:STDOUT: %.loc12_20.13: init i32 = initialize_from %.loc12_19.2 to %.loc12_20.12 -// CHECK:STDOUT: %.loc12_20.14: init [i32; 3] = array_init %.loc12_20.2, (%.loc12_20.7, %.loc12_20.10, %.loc12_20.13) to %.loc12_20.4 -// CHECK:STDOUT: %.loc12_20.15: ref [i32; 3] = temporary %.loc12_20.4, %.loc12_20.14 -// CHECK:STDOUT: %.loc12_20.16: [i32; 3] = bind_value %.loc12_20.15 -// CHECK:STDOUT: %.loc12_11.1: init i32 = call @F(%.loc12_20.16, %.loc12_23.2) +// CHECK:STDOUT: %.loc12_20.2: (i32, i32, i32) = tuple_literal (%.loc12_13, %.loc12_16, %.loc12_19) +// CHECK:STDOUT: %.loc12_23: i32 = int_literal 1 +// CHECK:STDOUT: %.loc12_20.3: ref [i32; 3] = temporary_storage +// CHECK:STDOUT: %.loc12_20.4: i32 = int_literal 0 +// CHECK:STDOUT: %.loc12_20.5: ref i32 = array_index %.loc12_20.3, %.loc12_20.4 +// CHECK:STDOUT: %.loc12_20.6: init i32 = initialize_from %.loc12_13 to %.loc12_20.5 +// CHECK:STDOUT: %.loc12_20.7: i32 = int_literal 1 +// CHECK:STDOUT: %.loc12_20.8: ref i32 = array_index %.loc12_20.3, %.loc12_20.7 +// CHECK:STDOUT: %.loc12_20.9: init i32 = initialize_from %.loc12_16 to %.loc12_20.8 +// CHECK:STDOUT: %.loc12_20.10: i32 = int_literal 2 +// CHECK:STDOUT: %.loc12_20.11: ref i32 = array_index %.loc12_20.3, %.loc12_20.10 +// CHECK:STDOUT: %.loc12_20.12: init i32 = initialize_from %.loc12_19 to %.loc12_20.11 +// CHECK:STDOUT: %.loc12_20.13: init [i32; 3] = array_init %.loc12_20.2, (%.loc12_20.6, %.loc12_20.9, %.loc12_20.12) to %.loc12_20.3 +// CHECK:STDOUT: %.loc12_20.14: ref [i32; 3] = temporary %.loc12_20.3, %.loc12_20.13 +// CHECK:STDOUT: %.loc12_20.15: [i32; 3] = bind_value %.loc12_20.14 +// CHECK:STDOUT: %.loc12_11.1: init i32 = call @F(%.loc12_20.15, %.loc12_23) // CHECK:STDOUT: %.loc12_11.2: ref i32 = temporary_storage // CHECK:STDOUT: %.loc12_11.3: ref i32 = temporary %.loc12_11.2, %.loc12_11.1 // CHECK:STDOUT: %.loc12_11.4: i32 = bind_value %.loc12_11.3 diff --git a/toolchain/check/testdata/array/nine_elements.carbon b/toolchain/check/testdata/array/nine_elements.carbon index 54a2c6c26459..d1b26fe4d904 100644 --- a/toolchain/check/testdata/array/nine_elements.carbon +++ b/toolchain/check/testdata/array/nine_elements.carbon @@ -10,54 +10,45 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: %.loc7_14: i32 = int_literal 9 // CHECK:STDOUT: %.loc7_15: type = array_type %.loc7_14, i32 // CHECK:STDOUT: %a: ref [i32; 9] = var "a" -// CHECK:STDOUT: %.loc7_20.1: i32 = int_literal 1 -// CHECK:STDOUT: %.loc7_20.2: i32 = stub_reference %.loc7_20.1 -// CHECK:STDOUT: %.loc7_23.1: i32 = int_literal 2 -// CHECK:STDOUT: %.loc7_23.2: i32 = stub_reference %.loc7_23.1 -// CHECK:STDOUT: %.loc7_26.1: i32 = int_literal 3 -// CHECK:STDOUT: %.loc7_26.2: i32 = stub_reference %.loc7_26.1 -// CHECK:STDOUT: %.loc7_29.1: i32 = int_literal 4 -// CHECK:STDOUT: %.loc7_29.2: i32 = stub_reference %.loc7_29.1 -// CHECK:STDOUT: %.loc7_32.1: i32 = int_literal 5 -// CHECK:STDOUT: %.loc7_32.2: i32 = stub_reference %.loc7_32.1 -// CHECK:STDOUT: %.loc7_35.1: i32 = int_literal 6 -// CHECK:STDOUT: %.loc7_35.2: i32 = stub_reference %.loc7_35.1 -// CHECK:STDOUT: %.loc7_38.1: i32 = int_literal 7 -// CHECK:STDOUT: %.loc7_38.2: i32 = stub_reference %.loc7_38.1 -// CHECK:STDOUT: %.loc7_41.1: i32 = int_literal 8 -// CHECK:STDOUT: %.loc7_41.2: i32 = stub_reference %.loc7_41.1 -// CHECK:STDOUT: %.loc7_44.1: i32 = int_literal 9 -// CHECK:STDOUT: %.loc7_44.2: i32 = stub_reference %.loc7_44.1 +// CHECK:STDOUT: %.loc7_20: i32 = int_literal 1 +// CHECK:STDOUT: %.loc7_23: i32 = int_literal 2 +// CHECK:STDOUT: %.loc7_26: i32 = int_literal 3 +// CHECK:STDOUT: %.loc7_29: i32 = int_literal 4 +// CHECK:STDOUT: %.loc7_32: i32 = int_literal 5 +// CHECK:STDOUT: %.loc7_35: i32 = int_literal 6 +// CHECK:STDOUT: %.loc7_38: i32 = int_literal 7 +// CHECK:STDOUT: %.loc7_41: i32 = int_literal 8 +// CHECK:STDOUT: %.loc7_44: i32 = int_literal 9 // CHECK:STDOUT: %.loc7_45.1: type = tuple_type (i32, i32, i32, i32, i32, i32, i32, i32, i32) -// CHECK:STDOUT: %.loc7_45.2: (i32, i32, i32, i32, i32, i32, i32, i32, i32) = tuple_literal (%.loc7_20.2, %.loc7_23.2, %.loc7_26.2, %.loc7_29.2, %.loc7_32.2, %.loc7_35.2, %.loc7_38.2, %.loc7_41.2, %.loc7_44.2) +// CHECK:STDOUT: %.loc7_45.2: (i32, i32, i32, i32, i32, i32, i32, i32, i32) = tuple_literal (%.loc7_20, %.loc7_23, %.loc7_26, %.loc7_29, %.loc7_32, %.loc7_35, %.loc7_38, %.loc7_41, %.loc7_44) // CHECK:STDOUT: %.loc7_45.3: ref [i32; 9] = stub_reference %a // CHECK:STDOUT: %.loc7_45.4: i32 = int_literal 0 // CHECK:STDOUT: %.loc7_45.5: ref i32 = array_index %.loc7_45.3, %.loc7_45.4 -// CHECK:STDOUT: %.loc7_45.6: init i32 = initialize_from %.loc7_20.2 to %.loc7_45.5 +// CHECK:STDOUT: %.loc7_45.6: init i32 = initialize_from %.loc7_20 to %.loc7_45.5 // CHECK:STDOUT: %.loc7_45.7: i32 = int_literal 1 // CHECK:STDOUT: %.loc7_45.8: ref i32 = array_index %.loc7_45.3, %.loc7_45.7 -// CHECK:STDOUT: %.loc7_45.9: init i32 = initialize_from %.loc7_23.2 to %.loc7_45.8 +// CHECK:STDOUT: %.loc7_45.9: init i32 = initialize_from %.loc7_23 to %.loc7_45.8 // CHECK:STDOUT: %.loc7_45.10: i32 = int_literal 2 // CHECK:STDOUT: %.loc7_45.11: ref i32 = array_index %.loc7_45.3, %.loc7_45.10 -// CHECK:STDOUT: %.loc7_45.12: init i32 = initialize_from %.loc7_26.2 to %.loc7_45.11 +// CHECK:STDOUT: %.loc7_45.12: init i32 = initialize_from %.loc7_26 to %.loc7_45.11 // CHECK:STDOUT: %.loc7_45.13: i32 = int_literal 3 // CHECK:STDOUT: %.loc7_45.14: ref i32 = array_index %.loc7_45.3, %.loc7_45.13 -// CHECK:STDOUT: %.loc7_45.15: init i32 = initialize_from %.loc7_29.2 to %.loc7_45.14 +// CHECK:STDOUT: %.loc7_45.15: init i32 = initialize_from %.loc7_29 to %.loc7_45.14 // CHECK:STDOUT: %.loc7_45.16: i32 = int_literal 4 // CHECK:STDOUT: %.loc7_45.17: ref i32 = array_index %.loc7_45.3, %.loc7_45.16 -// CHECK:STDOUT: %.loc7_45.18: init i32 = initialize_from %.loc7_32.2 to %.loc7_45.17 +// CHECK:STDOUT: %.loc7_45.18: init i32 = initialize_from %.loc7_32 to %.loc7_45.17 // CHECK:STDOUT: %.loc7_45.19: i32 = int_literal 5 // CHECK:STDOUT: %.loc7_45.20: ref i32 = array_index %.loc7_45.3, %.loc7_45.19 -// CHECK:STDOUT: %.loc7_45.21: init i32 = initialize_from %.loc7_35.2 to %.loc7_45.20 +// CHECK:STDOUT: %.loc7_45.21: init i32 = initialize_from %.loc7_35 to %.loc7_45.20 // CHECK:STDOUT: %.loc7_45.22: i32 = int_literal 6 // CHECK:STDOUT: %.loc7_45.23: ref i32 = array_index %.loc7_45.3, %.loc7_45.22 -// CHECK:STDOUT: %.loc7_45.24: init i32 = initialize_from %.loc7_38.2 to %.loc7_45.23 +// CHECK:STDOUT: %.loc7_45.24: init i32 = initialize_from %.loc7_38 to %.loc7_45.23 // CHECK:STDOUT: %.loc7_45.25: i32 = int_literal 7 // CHECK:STDOUT: %.loc7_45.26: ref i32 = array_index %.loc7_45.3, %.loc7_45.25 -// CHECK:STDOUT: %.loc7_45.27: init i32 = initialize_from %.loc7_41.2 to %.loc7_45.26 +// CHECK:STDOUT: %.loc7_45.27: init i32 = initialize_from %.loc7_41 to %.loc7_45.26 // CHECK:STDOUT: %.loc7_45.28: i32 = int_literal 8 // CHECK:STDOUT: %.loc7_45.29: ref i32 = array_index %.loc7_45.3, %.loc7_45.28 -// CHECK:STDOUT: %.loc7_45.30: init i32 = initialize_from %.loc7_44.2 to %.loc7_45.29 +// CHECK:STDOUT: %.loc7_45.30: init i32 = initialize_from %.loc7_44 to %.loc7_45.29 // CHECK:STDOUT: %.loc7_45.31: init [i32; 9] = array_init %.loc7_45.2, (%.loc7_45.6, %.loc7_45.9, %.loc7_45.12, %.loc7_45.15, %.loc7_45.18, %.loc7_45.21, %.loc7_45.24, %.loc7_45.27, %.loc7_45.30) to %.loc7_45.3 // CHECK:STDOUT: assign %a, %.loc7_45.31 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/basics/numeric_literals.carbon b/toolchain/check/testdata/basics/numeric_literals.carbon index ca29ff512f1c..997370f23297 100644 --- a/toolchain/check/testdata/basics/numeric_literals.carbon +++ b/toolchain/check/testdata/basics/numeric_literals.carbon @@ -34,77 +34,65 @@ fn F() { // CHECK:STDOUT: %.loc10_19: i32 = int_literal 5 // CHECK:STDOUT: %.loc10_20: type = array_type %.loc10_19, i32 // CHECK:STDOUT: %ints: ref [i32; 5] = var "ints" -// CHECK:STDOUT: %.loc11_5.1: i32 = int_literal 8 -// CHECK:STDOUT: %.loc11_5.2: i32 = stub_reference %.loc11_5.1 -// CHECK:STDOUT: %.loc12_5.1: i32 = int_literal 9 -// CHECK:STDOUT: %.loc12_5.2: i32 = stub_reference %.loc12_5.1 -// CHECK:STDOUT: %.loc13_5.1: i32 = int_literal 8 -// CHECK:STDOUT: %.loc13_5.2: i32 = stub_reference %.loc13_5.1 -// CHECK:STDOUT: %.loc14_5.1: i32 = int_literal 8 -// CHECK:STDOUT: %.loc14_5.2: i32 = stub_reference %.loc14_5.1 -// CHECK:STDOUT: %.loc15_5.1: i32 = int_literal 39999999999999999993 -// CHECK:STDOUT: %.loc15_5.2: i32 = stub_reference %.loc15_5.1 +// CHECK:STDOUT: %.loc11: i32 = int_literal 8 +// CHECK:STDOUT: %.loc12: i32 = int_literal 9 +// CHECK:STDOUT: %.loc13: i32 = int_literal 8 +// CHECK:STDOUT: %.loc14: i32 = int_literal 8 +// CHECK:STDOUT: %.loc15: i32 = int_literal 39999999999999999993 // CHECK:STDOUT: %.loc16_3.1: type = tuple_type (i32, i32, i32, i32, i32) -// CHECK:STDOUT: %.loc16_3.2: (i32, i32, i32, i32, i32) = tuple_literal (%.loc11_5.2, %.loc12_5.2, %.loc13_5.2, %.loc14_5.2, %.loc15_5.2) +// CHECK:STDOUT: %.loc16_3.2: (i32, i32, i32, i32, i32) = tuple_literal (%.loc11, %.loc12, %.loc13, %.loc14, %.loc15) // CHECK:STDOUT: %.loc16_3.3: ref [i32; 5] = stub_reference %ints // CHECK:STDOUT: %.loc16_3.4: i32 = int_literal 0 // CHECK:STDOUT: %.loc16_3.5: ref i32 = array_index %.loc16_3.3, %.loc16_3.4 -// CHECK:STDOUT: %.loc16_3.6: init i32 = initialize_from %.loc11_5.2 to %.loc16_3.5 +// CHECK:STDOUT: %.loc16_3.6: init i32 = initialize_from %.loc11 to %.loc16_3.5 // CHECK:STDOUT: %.loc16_3.7: i32 = int_literal 1 // CHECK:STDOUT: %.loc16_3.8: ref i32 = array_index %.loc16_3.3, %.loc16_3.7 -// CHECK:STDOUT: %.loc16_3.9: init i32 = initialize_from %.loc12_5.2 to %.loc16_3.8 +// CHECK:STDOUT: %.loc16_3.9: init i32 = initialize_from %.loc12 to %.loc16_3.8 // CHECK:STDOUT: %.loc16_3.10: i32 = int_literal 2 // CHECK:STDOUT: %.loc16_3.11: ref i32 = array_index %.loc16_3.3, %.loc16_3.10 -// CHECK:STDOUT: %.loc16_3.12: init i32 = initialize_from %.loc13_5.2 to %.loc16_3.11 +// CHECK:STDOUT: %.loc16_3.12: init i32 = initialize_from %.loc13 to %.loc16_3.11 // CHECK:STDOUT: %.loc16_3.13: i32 = int_literal 3 // CHECK:STDOUT: %.loc16_3.14: ref i32 = array_index %.loc16_3.3, %.loc16_3.13 -// CHECK:STDOUT: %.loc16_3.15: init i32 = initialize_from %.loc14_5.2 to %.loc16_3.14 +// CHECK:STDOUT: %.loc16_3.15: init i32 = initialize_from %.loc14 to %.loc16_3.14 // CHECK:STDOUT: %.loc16_3.16: i32 = int_literal 4 // CHECK:STDOUT: %.loc16_3.17: ref i32 = array_index %.loc16_3.3, %.loc16_3.16 -// CHECK:STDOUT: %.loc16_3.18: init i32 = initialize_from %.loc15_5.2 to %.loc16_3.17 +// CHECK:STDOUT: %.loc16_3.18: init i32 = initialize_from %.loc15 to %.loc16_3.17 // CHECK:STDOUT: %.loc16_3.19: init [i32; 5] = array_init %.loc16_3.2, (%.loc16_3.6, %.loc16_3.9, %.loc16_3.12, %.loc16_3.15, %.loc16_3.18) to %.loc16_3.3 // CHECK:STDOUT: assign %ints, %.loc16_3.19 // CHECK:STDOUT: %.loc17_21: i32 = int_literal 7 // CHECK:STDOUT: %.loc17_22: type = array_type %.loc17_21, f64 // CHECK:STDOUT: %floats: ref [f64; 7] = var "floats" -// CHECK:STDOUT: %.loc18_5.1: f64 = real_literal 9e-1 -// CHECK:STDOUT: %.loc18_5.2: f64 = stub_reference %.loc18_5.1 -// CHECK:STDOUT: %.loc19_5.1: f64 = real_literal 80e-1 -// CHECK:STDOUT: %.loc19_5.2: f64 = stub_reference %.loc19_5.1 -// CHECK:STDOUT: %.loc20_5.1: f64 = real_literal 800e-1 -// CHECK:STDOUT: %.loc20_5.2: f64 = stub_reference %.loc20_5.1 -// CHECK:STDOUT: %.loc21_5.1: f64 = real_literal 10e6 -// CHECK:STDOUT: %.loc21_5.2: f64 = stub_reference %.loc21_5.1 -// CHECK:STDOUT: %.loc22_5.1: f64 = real_literal 10e7 -// CHECK:STDOUT: %.loc22_5.2: f64 = stub_reference %.loc22_5.1 -// CHECK:STDOUT: %.loc23_5.1: f64 = real_literal 10e-9 -// CHECK:STDOUT: %.loc23_5.2: f64 = stub_reference %.loc23_5.1 -// CHECK:STDOUT: %.loc24_5.1: f64 = real_literal 399999999999999999930e39999999999999999992 -// CHECK:STDOUT: %.loc24_5.2: f64 = stub_reference %.loc24_5.1 +// CHECK:STDOUT: %.loc18: f64 = real_literal 9e-1 +// CHECK:STDOUT: %.loc19: f64 = real_literal 80e-1 +// CHECK:STDOUT: %.loc20: f64 = real_literal 800e-1 +// CHECK:STDOUT: %.loc21: f64 = real_literal 10e6 +// CHECK:STDOUT: %.loc22: f64 = real_literal 10e7 +// CHECK:STDOUT: %.loc23: f64 = real_literal 10e-9 +// CHECK:STDOUT: %.loc24: f64 = real_literal 399999999999999999930e39999999999999999992 // CHECK:STDOUT: %.loc25_3.1: type = tuple_type (f64, f64, f64, f64, f64, f64, f64) -// CHECK:STDOUT: %.loc25_3.2: (f64, f64, f64, f64, f64, f64, f64) = tuple_literal (%.loc18_5.2, %.loc19_5.2, %.loc20_5.2, %.loc21_5.2, %.loc22_5.2, %.loc23_5.2, %.loc24_5.2) +// CHECK:STDOUT: %.loc25_3.2: (f64, f64, f64, f64, f64, f64, f64) = tuple_literal (%.loc18, %.loc19, %.loc20, %.loc21, %.loc22, %.loc23, %.loc24) // CHECK:STDOUT: %.loc25_3.3: ref [f64; 7] = stub_reference %floats // CHECK:STDOUT: %.loc25_3.4: i32 = int_literal 0 // CHECK:STDOUT: %.loc25_3.5: ref f64 = array_index %.loc25_3.3, %.loc25_3.4 -// CHECK:STDOUT: %.loc25_3.6: init f64 = initialize_from %.loc18_5.2 to %.loc25_3.5 +// CHECK:STDOUT: %.loc25_3.6: init f64 = initialize_from %.loc18 to %.loc25_3.5 // CHECK:STDOUT: %.loc25_3.7: i32 = int_literal 1 // CHECK:STDOUT: %.loc25_3.8: ref f64 = array_index %.loc25_3.3, %.loc25_3.7 -// CHECK:STDOUT: %.loc25_3.9: init f64 = initialize_from %.loc19_5.2 to %.loc25_3.8 +// CHECK:STDOUT: %.loc25_3.9: init f64 = initialize_from %.loc19 to %.loc25_3.8 // CHECK:STDOUT: %.loc25_3.10: i32 = int_literal 2 // CHECK:STDOUT: %.loc25_3.11: ref f64 = array_index %.loc25_3.3, %.loc25_3.10 -// CHECK:STDOUT: %.loc25_3.12: init f64 = initialize_from %.loc20_5.2 to %.loc25_3.11 +// CHECK:STDOUT: %.loc25_3.12: init f64 = initialize_from %.loc20 to %.loc25_3.11 // CHECK:STDOUT: %.loc25_3.13: i32 = int_literal 3 // CHECK:STDOUT: %.loc25_3.14: ref f64 = array_index %.loc25_3.3, %.loc25_3.13 -// CHECK:STDOUT: %.loc25_3.15: init f64 = initialize_from %.loc21_5.2 to %.loc25_3.14 +// CHECK:STDOUT: %.loc25_3.15: init f64 = initialize_from %.loc21 to %.loc25_3.14 // CHECK:STDOUT: %.loc25_3.16: i32 = int_literal 4 // CHECK:STDOUT: %.loc25_3.17: ref f64 = array_index %.loc25_3.3, %.loc25_3.16 -// CHECK:STDOUT: %.loc25_3.18: init f64 = initialize_from %.loc22_5.2 to %.loc25_3.17 +// CHECK:STDOUT: %.loc25_3.18: init f64 = initialize_from %.loc22 to %.loc25_3.17 // CHECK:STDOUT: %.loc25_3.19: i32 = int_literal 5 // CHECK:STDOUT: %.loc25_3.20: ref f64 = array_index %.loc25_3.3, %.loc25_3.19 -// CHECK:STDOUT: %.loc25_3.21: init f64 = initialize_from %.loc23_5.2 to %.loc25_3.20 +// CHECK:STDOUT: %.loc25_3.21: init f64 = initialize_from %.loc23 to %.loc25_3.20 // CHECK:STDOUT: %.loc25_3.22: i32 = int_literal 6 // CHECK:STDOUT: %.loc25_3.23: ref f64 = array_index %.loc25_3.3, %.loc25_3.22 -// CHECK:STDOUT: %.loc25_3.24: init f64 = initialize_from %.loc24_5.2 to %.loc25_3.23 +// CHECK:STDOUT: %.loc25_3.24: init f64 = initialize_from %.loc24 to %.loc25_3.23 // CHECK:STDOUT: %.loc25_3.25: init [f64; 7] = array_init %.loc25_3.2, (%.loc25_3.6, %.loc25_3.9, %.loc25_3.12, %.loc25_3.15, %.loc25_3.18, %.loc25_3.21, %.loc25_3.24) to %.loc25_3.3 // CHECK:STDOUT: assign %floats, %.loc25_3.25 // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/basics/raw_and_textual_ir.carbon b/toolchain/check/testdata/basics/raw_and_textual_ir.carbon index 1d5242c1f0ae..9744dc5e0526 100644 --- a/toolchain/check/testdata/basics/raw_and_textual_ir.carbon +++ b/toolchain/check/testdata/basics/raw_and_textual_ir.carbon @@ -16,7 +16,7 @@ fn Foo(n: i32) -> (i32, f64) { // CHECK:STDOUT: sem_ir: // CHECK:STDOUT: - cross_reference_irs_size: 1 // CHECK:STDOUT: functions: [ -// CHECK:STDOUT: {name: str0, param_refs: block1, return_type: type3, return_slot: node+6, body: [block4]}, +// CHECK:STDOUT: {name: str0, param_refs: block1, return_type: type3, return_slot: node+4, body: [block4]}, // CHECK:STDOUT: ] // CHECK:STDOUT: integer_literals: [ // CHECK:STDOUT: 2, @@ -33,9 +33,9 @@ fn Foo(n: i32) -> (i32, f64) { // CHECK:STDOUT: ] // CHECK:STDOUT: types: [ // CHECK:STDOUT: nodeIntegerType, -// CHECK:STDOUT: node+3, +// CHECK:STDOUT: node+1, // CHECK:STDOUT: nodeFloatingPointType, -// CHECK:STDOUT: node+5, +// CHECK:STDOUT: node+3, // CHECK:STDOUT: ] // CHECK:STDOUT: type_blocks: [ // CHECK:STDOUT: [ @@ -49,27 +49,23 @@ fn Foo(n: i32) -> (i32, f64) { // CHECK:STDOUT: ] // CHECK:STDOUT: nodes: [ // CHECK:STDOUT: {kind: Parameter, arg0: str1, type: type0}, -// CHECK:STDOUT: {kind: StubReference, arg0: nodeIntegerType, type: typeTypeType}, -// CHECK:STDOUT: {kind: StubReference, arg0: nodeFloatingPointType, type: typeTypeType}, // CHECK:STDOUT: {kind: TupleType, arg0: typeBlock0, type: typeTypeType}, // CHECK:STDOUT: {kind: TupleLiteral, arg0: block2, type: type1}, // CHECK:STDOUT: {kind: TupleType, arg0: typeBlock1, type: typeTypeType}, // CHECK:STDOUT: {kind: VarStorage, arg0: str2, type: type3}, // CHECK:STDOUT: {kind: FunctionDeclaration, arg0: function0}, // CHECK:STDOUT: {kind: IntegerLiteral, arg0: int0, type: type0}, -// CHECK:STDOUT: {kind: BinaryOperatorAdd, arg0: node+0, arg1: node+8, type: type0}, -// CHECK:STDOUT: {kind: StubReference, arg0: node+9, type: type0}, +// CHECK:STDOUT: {kind: BinaryOperatorAdd, arg0: node+0, arg1: node+6, type: type0}, // CHECK:STDOUT: {kind: RealLiteral, arg0: real0, type: type2}, -// CHECK:STDOUT: {kind: StubReference, arg0: node+11, type: type2}, // CHECK:STDOUT: {kind: TupleLiteral, arg0: block5, type: type3}, // CHECK:STDOUT: {kind: IntegerLiteral, arg0: int1, type: type0}, -// CHECK:STDOUT: {kind: TupleIndex, arg0: node+6, arg1: node+14, type: type0}, -// CHECK:STDOUT: {kind: InitializeFrom, arg0: node+10, arg1: node+15, type: type0}, +// CHECK:STDOUT: {kind: TupleIndex, arg0: node+4, arg1: node+10, type: type0}, +// CHECK:STDOUT: {kind: InitializeFrom, arg0: node+7, arg1: node+11, type: type0}, // CHECK:STDOUT: {kind: IntegerLiteral, arg0: int2, type: type0}, -// CHECK:STDOUT: {kind: TupleIndex, arg0: node+6, arg1: node+17, type: type2}, -// CHECK:STDOUT: {kind: InitializeFrom, arg0: node+12, arg1: node+18, type: type2}, -// CHECK:STDOUT: {kind: TupleInit, arg0: node+13, arg1: block6, type: type3}, -// CHECK:STDOUT: {kind: ReturnExpression, arg0: node+20}, +// CHECK:STDOUT: {kind: TupleIndex, arg0: node+4, arg1: node+13, type: type2}, +// CHECK:STDOUT: {kind: InitializeFrom, arg0: node+8, arg1: node+14, type: type2}, +// CHECK:STDOUT: {kind: TupleInit, arg0: node+9, arg1: block6, type: type3}, +// CHECK:STDOUT: {kind: ReturnExpression, arg0: node+16}, // CHECK:STDOUT: ] // CHECK:STDOUT: node_blocks: [ // CHECK:STDOUT: [ @@ -78,8 +74,8 @@ fn Foo(n: i32) -> (i32, f64) { // CHECK:STDOUT: node+0, // CHECK:STDOUT: ], // CHECK:STDOUT: [ -// CHECK:STDOUT: node+1, -// CHECK:STDOUT: node+2, +// CHECK:STDOUT: nodeIntegerType, +// CHECK:STDOUT: nodeFloatingPointType, // CHECK:STDOUT: ], // CHECK:STDOUT: [ // CHECK:STDOUT: node+0, @@ -87,10 +83,10 @@ fn Foo(n: i32) -> (i32, f64) { // CHECK:STDOUT: node+2, // CHECK:STDOUT: node+3, // CHECK:STDOUT: node+4, -// CHECK:STDOUT: node+5, -// CHECK:STDOUT: node+6, // CHECK:STDOUT: ], // CHECK:STDOUT: [ +// CHECK:STDOUT: node+6, +// CHECK:STDOUT: node+7, // CHECK:STDOUT: node+8, // CHECK:STDOUT: node+9, // CHECK:STDOUT: node+10, @@ -101,21 +97,17 @@ fn Foo(n: i32) -> (i32, f64) { // CHECK:STDOUT: node+15, // CHECK:STDOUT: node+16, // CHECK:STDOUT: node+17, -// CHECK:STDOUT: node+18, -// CHECK:STDOUT: node+19, -// CHECK:STDOUT: node+20, -// CHECK:STDOUT: node+21, -// CHECK:STDOUT: ], -// CHECK:STDOUT: [ -// CHECK:STDOUT: node+10, -// CHECK:STDOUT: node+12, -// CHECK:STDOUT: ], -// CHECK:STDOUT: [ -// CHECK:STDOUT: node+16, -// CHECK:STDOUT: node+19, // CHECK:STDOUT: ], // CHECK:STDOUT: [ // CHECK:STDOUT: node+7, +// CHECK:STDOUT: node+8, +// CHECK:STDOUT: ], +// CHECK:STDOUT: [ +// CHECK:STDOUT: node+12, +// CHECK:STDOUT: node+15, +// CHECK:STDOUT: ], +// CHECK:STDOUT: [ +// CHECK:STDOUT: node+5, // CHECK:STDOUT: ], // CHECK:STDOUT: ] // CHECK:STDOUT: @@ -126,17 +118,15 @@ fn Foo(n: i32) -> (i32, f64) { // CHECK:STDOUT: fn @Foo(%n: i32) -> %return: (i32, f64) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc12_15: i32 = int_literal 2 -// CHECK:STDOUT: %.loc12_13.1: i32 = add %n, %.loc12_15 -// CHECK:STDOUT: %.loc12_13.2: i32 = stub_reference %.loc12_13.1 -// CHECK:STDOUT: %.loc12_18.1: f64 = real_literal 34e-1 -// CHECK:STDOUT: %.loc12_18.2: f64 = stub_reference %.loc12_18.1 -// CHECK:STDOUT: %.loc12_21: (i32, f64) = tuple_literal (%.loc12_13.2, %.loc12_18.2) +// CHECK:STDOUT: %.loc12_13: i32 = add %n, %.loc12_15 +// CHECK:STDOUT: %.loc12_18: f64 = real_literal 34e-1 +// CHECK:STDOUT: %.loc12_21: (i32, f64) = tuple_literal (%.loc12_13, %.loc12_18) // CHECK:STDOUT: %.loc12_22.1: i32 = int_literal 0 // CHECK:STDOUT: %.loc12_22.2: ref i32 = tuple_index %return, %.loc12_22.1 -// CHECK:STDOUT: %.loc12_22.3: init i32 = initialize_from %.loc12_13.2 to %.loc12_22.2 +// CHECK:STDOUT: %.loc12_22.3: init i32 = initialize_from %.loc12_13 to %.loc12_22.2 // CHECK:STDOUT: %.loc12_22.4: i32 = int_literal 1 // CHECK:STDOUT: %.loc12_22.5: ref f64 = tuple_index %return, %.loc12_22.4 -// CHECK:STDOUT: %.loc12_22.6: init f64 = initialize_from %.loc12_18.2 to %.loc12_22.5 +// CHECK:STDOUT: %.loc12_22.6: init f64 = initialize_from %.loc12_18 to %.loc12_22.5 // CHECK:STDOUT: %.loc12_22.7: init (i32, f64) = tuple_init %.loc12_21, (%.loc12_22.3, %.loc12_22.6) // CHECK:STDOUT: return %.loc12_22.7 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/basics/raw_ir.carbon b/toolchain/check/testdata/basics/raw_ir.carbon index 70395576ad8c..2fd23bc36e3e 100644 --- a/toolchain/check/testdata/basics/raw_ir.carbon +++ b/toolchain/check/testdata/basics/raw_ir.carbon @@ -16,7 +16,7 @@ fn Foo(n: i32) -> (i32, f64) { // CHECK:STDOUT: sem_ir: // CHECK:STDOUT: - cross_reference_irs_size: 1 // CHECK:STDOUT: functions: [ -// CHECK:STDOUT: {name: str0, param_refs: block1, return_type: type3, return_slot: node+6, body: [block4]}, +// CHECK:STDOUT: {name: str0, param_refs: block1, return_type: type3, return_slot: node+4, body: [block4]}, // CHECK:STDOUT: ] // CHECK:STDOUT: integer_literals: [ // CHECK:STDOUT: 2, @@ -33,9 +33,9 @@ fn Foo(n: i32) -> (i32, f64) { // CHECK:STDOUT: ] // CHECK:STDOUT: types: [ // CHECK:STDOUT: nodeIntegerType, -// CHECK:STDOUT: node+3, +// CHECK:STDOUT: node+1, // CHECK:STDOUT: nodeFloatingPointType, -// CHECK:STDOUT: node+5, +// CHECK:STDOUT: node+3, // CHECK:STDOUT: ] // CHECK:STDOUT: type_blocks: [ // CHECK:STDOUT: [ @@ -49,27 +49,23 @@ fn Foo(n: i32) -> (i32, f64) { // CHECK:STDOUT: ] // CHECK:STDOUT: nodes: [ // CHECK:STDOUT: {kind: Parameter, arg0: str1, type: type0}, -// CHECK:STDOUT: {kind: StubReference, arg0: nodeIntegerType, type: typeTypeType}, -// CHECK:STDOUT: {kind: StubReference, arg0: nodeFloatingPointType, type: typeTypeType}, // CHECK:STDOUT: {kind: TupleType, arg0: typeBlock0, type: typeTypeType}, // CHECK:STDOUT: {kind: TupleLiteral, arg0: block2, type: type1}, // CHECK:STDOUT: {kind: TupleType, arg0: typeBlock1, type: typeTypeType}, // CHECK:STDOUT: {kind: VarStorage, arg0: str2, type: type3}, // CHECK:STDOUT: {kind: FunctionDeclaration, arg0: function0}, // CHECK:STDOUT: {kind: IntegerLiteral, arg0: int0, type: type0}, -// CHECK:STDOUT: {kind: BinaryOperatorAdd, arg0: node+0, arg1: node+8, type: type0}, -// CHECK:STDOUT: {kind: StubReference, arg0: node+9, type: type0}, +// CHECK:STDOUT: {kind: BinaryOperatorAdd, arg0: node+0, arg1: node+6, type: type0}, // CHECK:STDOUT: {kind: RealLiteral, arg0: real0, type: type2}, -// CHECK:STDOUT: {kind: StubReference, arg0: node+11, type: type2}, // CHECK:STDOUT: {kind: TupleLiteral, arg0: block5, type: type3}, // CHECK:STDOUT: {kind: IntegerLiteral, arg0: int1, type: type0}, -// CHECK:STDOUT: {kind: TupleIndex, arg0: node+6, arg1: node+14, type: type0}, -// CHECK:STDOUT: {kind: InitializeFrom, arg0: node+10, arg1: node+15, type: type0}, +// CHECK:STDOUT: {kind: TupleIndex, arg0: node+4, arg1: node+10, type: type0}, +// CHECK:STDOUT: {kind: InitializeFrom, arg0: node+7, arg1: node+11, type: type0}, // CHECK:STDOUT: {kind: IntegerLiteral, arg0: int2, type: type0}, -// CHECK:STDOUT: {kind: TupleIndex, arg0: node+6, arg1: node+17, type: type2}, -// CHECK:STDOUT: {kind: InitializeFrom, arg0: node+12, arg1: node+18, type: type2}, -// CHECK:STDOUT: {kind: TupleInit, arg0: node+13, arg1: block6, type: type3}, -// CHECK:STDOUT: {kind: ReturnExpression, arg0: node+20}, +// CHECK:STDOUT: {kind: TupleIndex, arg0: node+4, arg1: node+13, type: type2}, +// CHECK:STDOUT: {kind: InitializeFrom, arg0: node+8, arg1: node+14, type: type2}, +// CHECK:STDOUT: {kind: TupleInit, arg0: node+9, arg1: block6, type: type3}, +// CHECK:STDOUT: {kind: ReturnExpression, arg0: node+16}, // CHECK:STDOUT: ] // CHECK:STDOUT: node_blocks: [ // CHECK:STDOUT: [ @@ -78,8 +74,8 @@ fn Foo(n: i32) -> (i32, f64) { // CHECK:STDOUT: node+0, // CHECK:STDOUT: ], // CHECK:STDOUT: [ -// CHECK:STDOUT: node+1, -// CHECK:STDOUT: node+2, +// CHECK:STDOUT: nodeIntegerType, +// CHECK:STDOUT: nodeFloatingPointType, // CHECK:STDOUT: ], // CHECK:STDOUT: [ // CHECK:STDOUT: node+0, @@ -87,10 +83,10 @@ fn Foo(n: i32) -> (i32, f64) { // CHECK:STDOUT: node+2, // CHECK:STDOUT: node+3, // CHECK:STDOUT: node+4, -// CHECK:STDOUT: node+5, -// CHECK:STDOUT: node+6, // CHECK:STDOUT: ], // CHECK:STDOUT: [ +// CHECK:STDOUT: node+6, +// CHECK:STDOUT: node+7, // CHECK:STDOUT: node+8, // CHECK:STDOUT: node+9, // CHECK:STDOUT: node+10, @@ -101,20 +97,16 @@ fn Foo(n: i32) -> (i32, f64) { // CHECK:STDOUT: node+15, // CHECK:STDOUT: node+16, // CHECK:STDOUT: node+17, -// CHECK:STDOUT: node+18, -// CHECK:STDOUT: node+19, -// CHECK:STDOUT: node+20, -// CHECK:STDOUT: node+21, -// CHECK:STDOUT: ], -// CHECK:STDOUT: [ -// CHECK:STDOUT: node+10, -// CHECK:STDOUT: node+12, -// CHECK:STDOUT: ], -// CHECK:STDOUT: [ -// CHECK:STDOUT: node+16, -// CHECK:STDOUT: node+19, // CHECK:STDOUT: ], // CHECK:STDOUT: [ // CHECK:STDOUT: node+7, +// CHECK:STDOUT: node+8, +// CHECK:STDOUT: ], +// CHECK:STDOUT: [ +// CHECK:STDOUT: node+12, +// CHECK:STDOUT: node+15, +// CHECK:STDOUT: ], +// CHECK:STDOUT: [ +// CHECK:STDOUT: node+5, // CHECK:STDOUT: ], // CHECK:STDOUT: ] diff --git a/toolchain/check/testdata/basics/textual_ir.carbon b/toolchain/check/testdata/basics/textual_ir.carbon index d0b061f406e5..e9dfee2fdfb2 100644 --- a/toolchain/check/testdata/basics/textual_ir.carbon +++ b/toolchain/check/testdata/basics/textual_ir.carbon @@ -19,17 +19,15 @@ fn Foo(n: i32) -> (i32, f64) { // CHECK:STDOUT: fn @Foo(%n: i32) -> %return: (i32, f64) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc12_15: i32 = int_literal 2 -// CHECK:STDOUT: %.loc12_13.1: i32 = add %n, %.loc12_15 -// CHECK:STDOUT: %.loc12_13.2: i32 = stub_reference %.loc12_13.1 -// CHECK:STDOUT: %.loc12_18.1: f64 = real_literal 34e-1 -// CHECK:STDOUT: %.loc12_18.2: f64 = stub_reference %.loc12_18.1 -// CHECK:STDOUT: %.loc12_21: (i32, f64) = tuple_literal (%.loc12_13.2, %.loc12_18.2) +// CHECK:STDOUT: %.loc12_13: i32 = add %n, %.loc12_15 +// CHECK:STDOUT: %.loc12_18: f64 = real_literal 34e-1 +// CHECK:STDOUT: %.loc12_21: (i32, f64) = tuple_literal (%.loc12_13, %.loc12_18) // CHECK:STDOUT: %.loc12_22.1: i32 = int_literal 0 // CHECK:STDOUT: %.loc12_22.2: ref i32 = tuple_index %return, %.loc12_22.1 -// CHECK:STDOUT: %.loc12_22.3: init i32 = initialize_from %.loc12_13.2 to %.loc12_22.2 +// CHECK:STDOUT: %.loc12_22.3: init i32 = initialize_from %.loc12_13 to %.loc12_22.2 // CHECK:STDOUT: %.loc12_22.4: i32 = int_literal 1 // CHECK:STDOUT: %.loc12_22.5: ref f64 = tuple_index %return, %.loc12_22.4 -// CHECK:STDOUT: %.loc12_22.6: init f64 = initialize_from %.loc12_18.2 to %.loc12_22.5 +// CHECK:STDOUT: %.loc12_22.6: init f64 = initialize_from %.loc12_18 to %.loc12_22.5 // CHECK:STDOUT: %.loc12_22.7: init (i32, f64) = tuple_init %.loc12_21, (%.loc12_22.3, %.loc12_22.6) // CHECK:STDOUT: return %.loc12_22.7 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/expression_category/in_place_tuple_initialization.carbon b/toolchain/check/testdata/expression_category/in_place_tuple_initialization.carbon index 093015b6300e..3a86291834a4 100644 --- a/toolchain/check/testdata/expression_category/in_place_tuple_initialization.carbon +++ b/toolchain/check/testdata/expression_category/in_place_tuple_initialization.carbon @@ -26,9 +26,7 @@ fn H() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @G() -> %return: (i32, i32) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc10_11: type = stub_reference i32 -// CHECK:STDOUT: %.loc10_16: type = stub_reference i32 -// CHECK:STDOUT: %.loc10_19: (type, type) = tuple_literal (%.loc10_11, %.loc10_16) +// CHECK:STDOUT: %.loc10_19: (type, type) = tuple_literal (i32, i32) // CHECK:STDOUT: %v: ref (i32, i32) = var "v" // CHECK:STDOUT: no_op // CHECK:STDOUT: %.loc10_24: init (i32, i32) = call @F() to %v diff --git a/toolchain/check/testdata/function/call/empty_struct.carbon b/toolchain/check/testdata/function/call/empty_struct.carbon index 952b1e3daee8..7191ee498a08 100644 --- a/toolchain/check/testdata/function/call/empty_struct.carbon +++ b/toolchain/check/testdata/function/call/empty_struct.carbon @@ -25,8 +25,7 @@ fn Main() { // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc12_9.1: {} = struct_literal () -// CHECK:STDOUT: %.loc12_9.2: {} = stub_reference %.loc12_9.1 -// CHECK:STDOUT: %.loc12_9.3: {} = struct_value %.loc12_9.1, () -// CHECK:STDOUT: %.loc12_7: init {} = call @Echo(%.loc12_9.3) +// CHECK:STDOUT: %.loc12_9.2: {} = struct_value %.loc12_9.1, () +// CHECK:STDOUT: %.loc12_7: init {} = call @Echo(%.loc12_9.2) // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/call/empty_tuple.carbon b/toolchain/check/testdata/function/call/empty_tuple.carbon index 30ded7ae14f9..baf5e0af77b5 100644 --- a/toolchain/check/testdata/function/call/empty_tuple.carbon +++ b/toolchain/check/testdata/function/call/empty_tuple.carbon @@ -25,8 +25,7 @@ fn Main() { // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc12_9.1: () = tuple_literal () -// CHECK:STDOUT: %.loc12_9.2: () = stub_reference %.loc12_9.1 -// CHECK:STDOUT: %.loc12_9.3: () = tuple_value %.loc12_9.1, () -// CHECK:STDOUT: %.loc12_7: init () = call @Echo(%.loc12_9.3) +// CHECK:STDOUT: %.loc12_9.2: () = tuple_value %.loc12_9.1, () +// CHECK:STDOUT: %.loc12_7: init () = call @Echo(%.loc12_9.2) // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/call/fail_param_count.carbon b/toolchain/check/testdata/function/call/fail_param_count.carbon index ca3c5ed44778..61027de7eb6d 100644 --- a/toolchain/check/testdata/function/call/fail_param_count.carbon +++ b/toolchain/check/testdata/function/call/fail_param_count.carbon @@ -79,18 +79,12 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc18_8.1: i32 = int_literal 1 -// CHECK:STDOUT: %.loc18_8.2: i32 = stub_reference %.loc18_8.1 +// CHECK:STDOUT: %.loc18_8: i32 = int_literal 1 // CHECK:STDOUT: %.loc18_7: type = tuple_type () -// CHECK:STDOUT: %.loc25_8.1: i32 = int_literal 0 -// CHECK:STDOUT: %.loc25_8.2: i32 = stub_reference %.loc25_8.1 -// CHECK:STDOUT: %.loc25_11.1: i32 = int_literal 1 -// CHECK:STDOUT: %.loc25_11.2: i32 = stub_reference %.loc25_11.1 -// CHECK:STDOUT: %.loc40_8.1: i32 = int_literal 0 -// CHECK:STDOUT: %.loc40_8.2: i32 = stub_reference %.loc40_8.1 -// CHECK:STDOUT: %.loc40_11.1: i32 = int_literal 1 -// CHECK:STDOUT: %.loc40_11.2: i32 = stub_reference %.loc40_11.1 -// CHECK:STDOUT: %.loc55_8.1: i32 = int_literal 0 -// CHECK:STDOUT: %.loc55_8.2: i32 = stub_reference %.loc55_8.1 +// CHECK:STDOUT: %.loc25_8: i32 = int_literal 0 +// CHECK:STDOUT: %.loc25_11: i32 = int_literal 1 +// CHECK:STDOUT: %.loc40_8: i32 = int_literal 0 +// CHECK:STDOUT: %.loc40_11: i32 = int_literal 1 +// CHECK:STDOUT: %.loc55: i32 = int_literal 0 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/call/fail_param_type.carbon b/toolchain/check/testdata/function/call/fail_param_type.carbon index 0f05507759d5..ee177c289015 100644 --- a/toolchain/check/testdata/function/call/fail_param_type.carbon +++ b/toolchain/check/testdata/function/call/fail_param_type.carbon @@ -28,8 +28,7 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc16_7.1: f64 = real_literal 10e-1 -// CHECK:STDOUT: %.loc16_7.2: f64 = stub_reference %.loc16_7.1 +// CHECK:STDOUT: %.loc16_7: f64 = real_literal 10e-1 // CHECK:STDOUT: %.loc16_6: type = tuple_type () // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/call/i32.carbon b/toolchain/check/testdata/function/call/i32.carbon index 69d324b29485..07f8ce94bd1e 100644 --- a/toolchain/check/testdata/function/call/i32.carbon +++ b/toolchain/check/testdata/function/call/i32.carbon @@ -25,9 +25,8 @@ fn Main() { // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %b: ref i32 = var "b" -// CHECK:STDOUT: %.loc12_21.1: i32 = int_literal 1 -// CHECK:STDOUT: %.loc12_21.2: i32 = stub_reference %.loc12_21.1 -// CHECK:STDOUT: %.loc12_20: init i32 = call @Echo(%.loc12_21.2) +// CHECK:STDOUT: %.loc12_21: i32 = int_literal 1 +// CHECK:STDOUT: %.loc12_20: init i32 = call @Echo(%.loc12_21) // CHECK:STDOUT: assign %b, %.loc12_20 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/call/more_param_ir.carbon b/toolchain/check/testdata/function/call/more_param_ir.carbon index d0815e2f9d7b..1f95563f7340 100644 --- a/toolchain/check/testdata/function/call/more_param_ir.carbon +++ b/toolchain/check/testdata/function/call/more_param_ir.carbon @@ -27,15 +27,12 @@ fn Main() { // CHECK:STDOUT: %.loc11_11: i32 = int_literal 2 // CHECK:STDOUT: %.loc11_9: i32 = add %.loc11_7, %.loc11_11 // CHECK:STDOUT: %.loc11_15: i32 = int_literal 3 -// CHECK:STDOUT: %.loc11_13.1: i32 = add %.loc11_9, %.loc11_15 -// CHECK:STDOUT: %.loc11_13.2: i32 = stub_reference %.loc11_13.1 +// CHECK:STDOUT: %.loc11_13: i32 = add %.loc11_9, %.loc11_15 // CHECK:STDOUT: %.loc11_18: i32 = int_literal 4 // CHECK:STDOUT: %.loc11_22: i32 = int_literal 5 -// CHECK:STDOUT: %.loc11_20.1: i32 = add %.loc11_18, %.loc11_22 -// CHECK:STDOUT: %.loc11_20.2: i32 = stub_reference %.loc11_20.1 -// CHECK:STDOUT: %.loc11_25.1: i32 = int_literal 6 -// CHECK:STDOUT: %.loc11_25.2: i32 = stub_reference %.loc11_25.1 +// CHECK:STDOUT: %.loc11_20: i32 = add %.loc11_18, %.loc11_22 +// CHECK:STDOUT: %.loc11_25: i32 = int_literal 6 // CHECK:STDOUT: %.loc11_6.1: type = tuple_type () -// CHECK:STDOUT: %.loc11_6.2: init () = call @Foo(%.loc11_13.2, %.loc11_20.2, %.loc11_25.2) +// CHECK:STDOUT: %.loc11_6.2: init () = call @Foo(%.loc11_13, %.loc11_20, %.loc11_25) // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/call/params_one.carbon b/toolchain/check/testdata/function/call/params_one.carbon index 2ef1bae3abc4..6c975b62e2df 100644 --- a/toolchain/check/testdata/function/call/params_one.carbon +++ b/toolchain/check/testdata/function/call/params_one.carbon @@ -22,9 +22,8 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc10_7.1: i32 = int_literal 1 -// CHECK:STDOUT: %.loc10_7.2: i32 = stub_reference %.loc10_7.1 +// CHECK:STDOUT: %.loc10_7: i32 = int_literal 1 // CHECK:STDOUT: %.loc10_6.1: type = tuple_type () -// CHECK:STDOUT: %.loc10_6.2: init () = call @Foo(%.loc10_7.2) +// CHECK:STDOUT: %.loc10_6.2: init () = call @Foo(%.loc10_7) // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/call/params_one_comma.carbon b/toolchain/check/testdata/function/call/params_one_comma.carbon index f978279fe589..e24cc3099ad9 100644 --- a/toolchain/check/testdata/function/call/params_one_comma.carbon +++ b/toolchain/check/testdata/function/call/params_one_comma.carbon @@ -23,12 +23,10 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc10_7.1: i32 = int_literal 1 -// CHECK:STDOUT: %.loc10_7.2: i32 = stub_reference %.loc10_7.1 +// CHECK:STDOUT: %.loc10_7: i32 = int_literal 1 // CHECK:STDOUT: %.loc10_6.1: type = tuple_type () -// CHECK:STDOUT: %.loc10_6.2: init () = call @Foo(%.loc10_7.2) -// CHECK:STDOUT: %.loc11_7.1: i32 = int_literal 1 -// CHECK:STDOUT: %.loc11_7.2: i32 = stub_reference %.loc11_7.1 -// CHECK:STDOUT: %.loc11_6: init () = call @Foo(%.loc11_7.2) +// CHECK:STDOUT: %.loc10_6.2: init () = call @Foo(%.loc10_7) +// CHECK:STDOUT: %.loc11_7: i32 = int_literal 1 +// CHECK:STDOUT: %.loc11_6: init () = call @Foo(%.loc11_7) // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/call/params_two.carbon b/toolchain/check/testdata/function/call/params_two.carbon index 1ece1f7bff43..13fe46412ff8 100644 --- a/toolchain/check/testdata/function/call/params_two.carbon +++ b/toolchain/check/testdata/function/call/params_two.carbon @@ -22,11 +22,9 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc10_7.1: i32 = int_literal 1 -// CHECK:STDOUT: %.loc10_7.2: i32 = stub_reference %.loc10_7.1 -// CHECK:STDOUT: %.loc10_10.1: i32 = int_literal 2 -// CHECK:STDOUT: %.loc10_10.2: i32 = stub_reference %.loc10_10.1 +// CHECK:STDOUT: %.loc10_7: i32 = int_literal 1 +// CHECK:STDOUT: %.loc10_10: i32 = int_literal 2 // CHECK:STDOUT: %.loc10_6.1: type = tuple_type () -// CHECK:STDOUT: %.loc10_6.2: init () = call @Foo(%.loc10_7.2, %.loc10_10.2) +// CHECK:STDOUT: %.loc10_6.2: init () = call @Foo(%.loc10_7, %.loc10_10) // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/call/params_two_comma.carbon b/toolchain/check/testdata/function/call/params_two_comma.carbon index b1d5deef1fb7..efa1c51a7c0e 100644 --- a/toolchain/check/testdata/function/call/params_two_comma.carbon +++ b/toolchain/check/testdata/function/call/params_two_comma.carbon @@ -23,16 +23,12 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc10_7.1: i32 = int_literal 1 -// CHECK:STDOUT: %.loc10_7.2: i32 = stub_reference %.loc10_7.1 -// CHECK:STDOUT: %.loc10_10.1: i32 = int_literal 2 -// CHECK:STDOUT: %.loc10_10.2: i32 = stub_reference %.loc10_10.1 +// CHECK:STDOUT: %.loc10_7: i32 = int_literal 1 +// CHECK:STDOUT: %.loc10_10: i32 = int_literal 2 // CHECK:STDOUT: %.loc10_6.1: type = tuple_type () -// CHECK:STDOUT: %.loc10_6.2: init () = call @Foo(%.loc10_7.2, %.loc10_10.2) -// CHECK:STDOUT: %.loc11_7.1: i32 = int_literal 1 -// CHECK:STDOUT: %.loc11_7.2: i32 = stub_reference %.loc11_7.1 -// CHECK:STDOUT: %.loc11_10.1: i32 = int_literal 2 -// CHECK:STDOUT: %.loc11_10.2: i32 = stub_reference %.loc11_10.1 -// CHECK:STDOUT: %.loc11_6: init () = call @Foo(%.loc11_7.2, %.loc11_10.2) +// CHECK:STDOUT: %.loc10_6.2: init () = call @Foo(%.loc10_7, %.loc10_10) +// CHECK:STDOUT: %.loc11_7: i32 = int_literal 1 +// CHECK:STDOUT: %.loc11_10: i32 = int_literal 2 +// CHECK:STDOUT: %.loc11_6: init () = call @Foo(%.loc11_7, %.loc11_10) // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/index/array_element_access.carbon b/toolchain/check/testdata/index/array_element_access.carbon index 5c4ddf3fb4a2..c7c340abe9b9 100644 --- a/toolchain/check/testdata/index/array_element_access.carbon +++ b/toolchain/check/testdata/index/array_element_access.carbon @@ -13,19 +13,17 @@ var d: i32 = a[b]; // CHECK:STDOUT: %.loc7_14: i32 = int_literal 2 // CHECK:STDOUT: %.loc7_15: type = array_type %.loc7_14, i32 // CHECK:STDOUT: %a: ref [i32; 2] = var "a" -// CHECK:STDOUT: %.loc7_20.1: i32 = int_literal 12 -// CHECK:STDOUT: %.loc7_20.2: i32 = stub_reference %.loc7_20.1 -// CHECK:STDOUT: %.loc7_24.1: i32 = int_literal 24 -// CHECK:STDOUT: %.loc7_24.2: i32 = stub_reference %.loc7_24.1 +// CHECK:STDOUT: %.loc7_20: i32 = int_literal 12 +// CHECK:STDOUT: %.loc7_24: i32 = int_literal 24 // CHECK:STDOUT: %.loc7_26.1: type = tuple_type (i32, i32) -// CHECK:STDOUT: %.loc7_26.2: (i32, i32) = tuple_literal (%.loc7_20.2, %.loc7_24.2) +// CHECK:STDOUT: %.loc7_26.2: (i32, i32) = tuple_literal (%.loc7_20, %.loc7_24) // CHECK:STDOUT: %.loc7_26.3: ref [i32; 2] = stub_reference %a // CHECK:STDOUT: %.loc7_26.4: i32 = int_literal 0 // CHECK:STDOUT: %.loc7_26.5: ref i32 = array_index %.loc7_26.3, %.loc7_26.4 -// CHECK:STDOUT: %.loc7_26.6: init i32 = initialize_from %.loc7_20.2 to %.loc7_26.5 +// CHECK:STDOUT: %.loc7_26.6: init i32 = initialize_from %.loc7_20 to %.loc7_26.5 // CHECK:STDOUT: %.loc7_26.7: i32 = int_literal 1 // CHECK:STDOUT: %.loc7_26.8: ref i32 = array_index %.loc7_26.3, %.loc7_26.7 -// CHECK:STDOUT: %.loc7_26.9: init i32 = initialize_from %.loc7_24.2 to %.loc7_26.8 +// CHECK:STDOUT: %.loc7_26.9: init i32 = initialize_from %.loc7_24 to %.loc7_26.8 // CHECK:STDOUT: %.loc7_26.10: init [i32; 2] = array_init %.loc7_26.2, (%.loc7_26.6, %.loc7_26.9) to %.loc7_26.3 // CHECK:STDOUT: assign %a, %.loc7_26.10 // CHECK:STDOUT: %b: ref i32 = var "b" diff --git a/toolchain/check/testdata/index/fail_array_large_index.carbon b/toolchain/check/testdata/index/fail_array_large_index.carbon index 724cc1c3ed96..83d0d7954530 100644 --- a/toolchain/check/testdata/index/fail_array_large_index.carbon +++ b/toolchain/check/testdata/index/fail_array_large_index.carbon @@ -14,14 +14,13 @@ var b: i32 = a[0xFFFFFFFFFFFFFFFFF]; // CHECK:STDOUT: %.loc7_14: i32 = int_literal 1 // CHECK:STDOUT: %.loc7_15: type = array_type %.loc7_14, i32 // CHECK:STDOUT: %a: ref [i32; 1] = var "a" -// CHECK:STDOUT: %.loc7_20.1: i32 = int_literal 12 -// CHECK:STDOUT: %.loc7_20.2: i32 = stub_reference %.loc7_20.1 +// CHECK:STDOUT: %.loc7_20: i32 = int_literal 12 // CHECK:STDOUT: %.loc7_23.1: type = tuple_type (i32) -// CHECK:STDOUT: %.loc7_23.2: (i32,) = tuple_literal (%.loc7_20.2) +// CHECK:STDOUT: %.loc7_23.2: (i32,) = tuple_literal (%.loc7_20) // CHECK:STDOUT: %.loc7_23.3: ref [i32; 1] = stub_reference %a // CHECK:STDOUT: %.loc7_23.4: i32 = int_literal 0 // CHECK:STDOUT: %.loc7_23.5: ref i32 = array_index %.loc7_23.3, %.loc7_23.4 -// CHECK:STDOUT: %.loc7_23.6: init i32 = initialize_from %.loc7_20.2 to %.loc7_23.5 +// CHECK:STDOUT: %.loc7_23.6: init i32 = initialize_from %.loc7_20 to %.loc7_23.5 // CHECK:STDOUT: %.loc7_23.7: init [i32; 1] = array_init %.loc7_23.2, (%.loc7_23.6) to %.loc7_23.3 // CHECK:STDOUT: assign %a, %.loc7_23.7 // CHECK:STDOUT: %b: ref i32 = var "b" diff --git a/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon b/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon index bae62520678b..281bce49438c 100644 --- a/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon +++ b/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon @@ -14,14 +14,13 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: %.loc7_14: i32 = int_literal 1 // CHECK:STDOUT: %.loc7_15: type = array_type %.loc7_14, i32 // CHECK:STDOUT: %a: ref [i32; 1] = var "a" -// CHECK:STDOUT: %.loc7_20.1: i32 = int_literal 12 -// CHECK:STDOUT: %.loc7_20.2: i32 = stub_reference %.loc7_20.1 +// CHECK:STDOUT: %.loc7_20: i32 = int_literal 12 // CHECK:STDOUT: %.loc7_23.1: type = tuple_type (i32) -// CHECK:STDOUT: %.loc7_23.2: (i32,) = tuple_literal (%.loc7_20.2) +// CHECK:STDOUT: %.loc7_23.2: (i32,) = tuple_literal (%.loc7_20) // CHECK:STDOUT: %.loc7_23.3: ref [i32; 1] = stub_reference %a // CHECK:STDOUT: %.loc7_23.4: i32 = int_literal 0 // CHECK:STDOUT: %.loc7_23.5: ref i32 = array_index %.loc7_23.3, %.loc7_23.4 -// CHECK:STDOUT: %.loc7_23.6: init i32 = initialize_from %.loc7_20.2 to %.loc7_23.5 +// CHECK:STDOUT: %.loc7_23.6: init i32 = initialize_from %.loc7_20 to %.loc7_23.5 // CHECK:STDOUT: %.loc7_23.7: init [i32; 1] = array_init %.loc7_23.2, (%.loc7_23.6) to %.loc7_23.3 // CHECK:STDOUT: assign %a, %.loc7_23.7 // CHECK:STDOUT: %b: ref i32 = var "b" diff --git a/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon b/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon index cd7bc3ee87fb..125d0bc3d570 100644 --- a/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon +++ b/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon @@ -14,14 +14,13 @@ var b: i32 = a[2]; // CHECK:STDOUT: %.loc7_14: i32 = int_literal 1 // CHECK:STDOUT: %.loc7_15: type = array_type %.loc7_14, i32 // CHECK:STDOUT: %a: ref [i32; 1] = var "a" -// CHECK:STDOUT: %.loc7_20.1: i32 = int_literal 12 -// CHECK:STDOUT: %.loc7_20.2: i32 = stub_reference %.loc7_20.1 +// CHECK:STDOUT: %.loc7_20: i32 = int_literal 12 // CHECK:STDOUT: %.loc7_23.1: type = tuple_type (i32) -// CHECK:STDOUT: %.loc7_23.2: (i32,) = tuple_literal (%.loc7_20.2) +// CHECK:STDOUT: %.loc7_23.2: (i32,) = tuple_literal (%.loc7_20) // CHECK:STDOUT: %.loc7_23.3: ref [i32; 1] = stub_reference %a // CHECK:STDOUT: %.loc7_23.4: i32 = int_literal 0 // CHECK:STDOUT: %.loc7_23.5: ref i32 = array_index %.loc7_23.3, %.loc7_23.4 -// CHECK:STDOUT: %.loc7_23.6: init i32 = initialize_from %.loc7_20.2 to %.loc7_23.5 +// CHECK:STDOUT: %.loc7_23.6: init i32 = initialize_from %.loc7_20 to %.loc7_23.5 // CHECK:STDOUT: %.loc7_23.7: init [i32; 1] = array_init %.loc7_23.2, (%.loc7_23.6) to %.loc7_23.3 // CHECK:STDOUT: assign %a, %.loc7_23.7 // CHECK:STDOUT: %b: ref i32 = var "b" diff --git a/toolchain/check/testdata/index/fail_invalid_base.carbon b/toolchain/check/testdata/index/fail_invalid_base.carbon index 4f50af8037f5..f22d84c32b70 100644 --- a/toolchain/check/testdata/index/fail_invalid_base.carbon +++ b/toolchain/check/testdata/index/fail_invalid_base.carbon @@ -41,13 +41,11 @@ var d: i32 = {.a: i32, .b: i32}[0]; // CHECK:STDOUT: assign %b, // CHECK:STDOUT: %c: ref i32 = var "c" // CHECK:STDOUT: %.loc26_20: i32 = int_literal 1 -// CHECK:STDOUT: %.loc26_18: i32 = stub_reference %.loc26_20 // CHECK:STDOUT: %.loc26_28: i32 = int_literal 2 -// CHECK:STDOUT: %.loc26_26: i32 = stub_reference %.loc26_28 // CHECK:STDOUT: %.loc26_29.1: type = struct_type {.a: i32, .b: i32} -// CHECK:STDOUT: %.loc26_29.2: {.a: i32, .b: i32} = struct_literal (%.loc26_18, %.loc26_26) +// CHECK:STDOUT: %.loc26_29.2: {.a: i32, .b: i32} = struct_literal (%.loc26_20, %.loc26_28) // CHECK:STDOUT: %.loc26_31: i32 = int_literal 0 -// CHECK:STDOUT: %.loc26_29.3: {.a: i32, .b: i32} = struct_value %.loc26_29.2, (%.loc26_18, %.loc26_26) +// CHECK:STDOUT: %.loc26_29.3: {.a: i32, .b: i32} = struct_value %.loc26_29.2, (%.loc26_20, %.loc26_28) // CHECK:STDOUT: assign %c, // CHECK:STDOUT: %d: ref i32 = var "d" // CHECK:STDOUT: %.loc31_31: type = struct_type {.a: i32, .b: i32} diff --git a/toolchain/check/testdata/index/fail_non_deterministic_type.carbon b/toolchain/check/testdata/index/fail_non_deterministic_type.carbon index 32964d7a22fd..d387717afef9 100644 --- a/toolchain/check/testdata/index/fail_non_deterministic_type.carbon +++ b/toolchain/check/testdata/index/fail_non_deterministic_type.carbon @@ -12,23 +12,19 @@ var b: i32 = 0; var c: i32 = a[b]; // CHECK:STDOUT: file "fail_non_deterministic_type.carbon" { -// CHECK:STDOUT: %.loc7_9: type = stub_reference i32 -// CHECK:STDOUT: %.loc7_14: type = stub_reference i32 // CHECK:STDOUT: %.loc7_17.1: type = tuple_type (type, type) -// CHECK:STDOUT: %.loc7_17.2: (type, type) = tuple_literal (%.loc7_9, %.loc7_14) +// CHECK:STDOUT: %.loc7_17.2: (type, type) = tuple_literal (i32, i32) // CHECK:STDOUT: %.loc7_17.3: type = tuple_type (i32, i32) // CHECK:STDOUT: %a: ref (i32, i32) = var "a" -// CHECK:STDOUT: %.loc7_22.1: i32 = int_literal 2 -// CHECK:STDOUT: %.loc7_22.2: i32 = stub_reference %.loc7_22.1 -// CHECK:STDOUT: %.loc7_25.1: i32 = int_literal 3 -// CHECK:STDOUT: %.loc7_25.2: i32 = stub_reference %.loc7_25.1 -// CHECK:STDOUT: %.loc7_26: (i32, i32) = tuple_literal (%.loc7_22.2, %.loc7_25.2) +// CHECK:STDOUT: %.loc7_22: i32 = int_literal 2 +// CHECK:STDOUT: %.loc7_25: i32 = int_literal 3 +// CHECK:STDOUT: %.loc7_26: (i32, i32) = tuple_literal (%.loc7_22, %.loc7_25) // CHECK:STDOUT: %.loc7_27.1: i32 = int_literal 0 // CHECK:STDOUT: %.loc7_27.2: ref i32 = tuple_index %a, %.loc7_27.1 -// CHECK:STDOUT: %.loc7_27.3: init i32 = initialize_from %.loc7_22.2 to %.loc7_27.2 +// CHECK:STDOUT: %.loc7_27.3: init i32 = initialize_from %.loc7_22 to %.loc7_27.2 // CHECK:STDOUT: %.loc7_27.4: i32 = int_literal 1 // CHECK:STDOUT: %.loc7_27.5: ref i32 = tuple_index %a, %.loc7_27.4 -// CHECK:STDOUT: %.loc7_27.6: init i32 = initialize_from %.loc7_25.2 to %.loc7_27.5 +// CHECK:STDOUT: %.loc7_27.6: init i32 = initialize_from %.loc7_25 to %.loc7_27.5 // CHECK:STDOUT: %.loc7_27.7: init (i32, i32) = tuple_init %.loc7_26, (%.loc7_27.3, %.loc7_27.6) // CHECK:STDOUT: assign %a, %.loc7_27.7 // CHECK:STDOUT: %b: ref i32 = var "b" diff --git a/toolchain/check/testdata/index/fail_tuple_large_index.carbon b/toolchain/check/testdata/index/fail_tuple_large_index.carbon index 588aa0f7ef8f..2c66da168281 100644 --- a/toolchain/check/testdata/index/fail_tuple_large_index.carbon +++ b/toolchain/check/testdata/index/fail_tuple_large_index.carbon @@ -12,20 +12,17 @@ var b: (i32,) = a; var c: i32 = b[0xFFFFFFFFFFFFFFFFF]; // CHECK:STDOUT: file "fail_tuple_large_index.carbon" { -// CHECK:STDOUT: %.loc7_9: type = stub_reference i32 // CHECK:STDOUT: %.loc7_13.1: type = tuple_type (type) -// CHECK:STDOUT: %.loc7_13.2: (type,) = tuple_literal (%.loc7_9) +// CHECK:STDOUT: %.loc7_13.2: (type,) = tuple_literal (i32) // CHECK:STDOUT: %.loc7_13.3: type = tuple_type (i32) // CHECK:STDOUT: %a: ref (i32,) = var "a" -// CHECK:STDOUT: %.loc7_18.1: i32 = int_literal 12 -// CHECK:STDOUT: %.loc7_18.2: i32 = stub_reference %.loc7_18.1 -// CHECK:STDOUT: %.loc7_21: (i32,) = tuple_literal (%.loc7_18.2) +// CHECK:STDOUT: %.loc7_18: i32 = int_literal 12 +// CHECK:STDOUT: %.loc7_21: (i32,) = tuple_literal (%.loc7_18) // CHECK:STDOUT: %.loc7_22.1: i32 = int_literal 0 // CHECK:STDOUT: %.loc7_22.2: ref i32 = tuple_index %a, %.loc7_22.1 -// CHECK:STDOUT: %.loc7_22.3: init (i32,) = tuple_init %.loc7_21, (%.loc7_18.2) +// CHECK:STDOUT: %.loc7_22.3: init (i32,) = tuple_init %.loc7_21, (%.loc7_18) // CHECK:STDOUT: assign %a, %.loc7_22.3 -// CHECK:STDOUT: %.loc8_9: type = stub_reference i32 -// CHECK:STDOUT: %.loc8_13: (type,) = tuple_literal (%.loc8_9) +// CHECK:STDOUT: %.loc8: (type,) = tuple_literal (i32) // CHECK:STDOUT: %b: ref (i32,) = var "b" // CHECK:STDOUT: %.loc7_5: (i32,) = bind_value %a // CHECK:STDOUT: assign %b, %.loc7_5 diff --git a/toolchain/check/testdata/index/fail_tuple_non_int_indexing.carbon b/toolchain/check/testdata/index/fail_tuple_non_int_indexing.carbon index 00e10d68ca93..6251430786dd 100644 --- a/toolchain/check/testdata/index/fail_tuple_non_int_indexing.carbon +++ b/toolchain/check/testdata/index/fail_tuple_non_int_indexing.carbon @@ -11,23 +11,19 @@ var a: (i32, i32) = (12, 6); var b: i32 = a[2.6]; // CHECK:STDOUT: file "fail_tuple_non_int_indexing.carbon" { -// CHECK:STDOUT: %.loc7_9: type = stub_reference i32 -// CHECK:STDOUT: %.loc7_14: type = stub_reference i32 // CHECK:STDOUT: %.loc7_17.1: type = tuple_type (type, type) -// CHECK:STDOUT: %.loc7_17.2: (type, type) = tuple_literal (%.loc7_9, %.loc7_14) +// CHECK:STDOUT: %.loc7_17.2: (type, type) = tuple_literal (i32, i32) // CHECK:STDOUT: %.loc7_17.3: type = tuple_type (i32, i32) // CHECK:STDOUT: %a: ref (i32, i32) = var "a" -// CHECK:STDOUT: %.loc7_22.1: i32 = int_literal 12 -// CHECK:STDOUT: %.loc7_22.2: i32 = stub_reference %.loc7_22.1 -// CHECK:STDOUT: %.loc7_26.1: i32 = int_literal 6 -// CHECK:STDOUT: %.loc7_26.2: i32 = stub_reference %.loc7_26.1 -// CHECK:STDOUT: %.loc7_27: (i32, i32) = tuple_literal (%.loc7_22.2, %.loc7_26.2) +// CHECK:STDOUT: %.loc7_22: i32 = int_literal 12 +// CHECK:STDOUT: %.loc7_26: i32 = int_literal 6 +// CHECK:STDOUT: %.loc7_27: (i32, i32) = tuple_literal (%.loc7_22, %.loc7_26) // CHECK:STDOUT: %.loc7_28.1: i32 = int_literal 0 // CHECK:STDOUT: %.loc7_28.2: ref i32 = tuple_index %a, %.loc7_28.1 -// CHECK:STDOUT: %.loc7_28.3: init i32 = initialize_from %.loc7_22.2 to %.loc7_28.2 +// CHECK:STDOUT: %.loc7_28.3: init i32 = initialize_from %.loc7_22 to %.loc7_28.2 // CHECK:STDOUT: %.loc7_28.4: i32 = int_literal 1 // CHECK:STDOUT: %.loc7_28.5: ref i32 = tuple_index %a, %.loc7_28.4 -// CHECK:STDOUT: %.loc7_28.6: init i32 = initialize_from %.loc7_26.2 to %.loc7_28.5 +// CHECK:STDOUT: %.loc7_28.6: init i32 = initialize_from %.loc7_26 to %.loc7_28.5 // CHECK:STDOUT: %.loc7_28.7: init (i32, i32) = tuple_init %.loc7_27, (%.loc7_28.3, %.loc7_28.6) // CHECK:STDOUT: assign %a, %.loc7_28.7 // CHECK:STDOUT: %b: ref i32 = var "b" diff --git a/toolchain/check/testdata/index/fail_tuple_out_of_bound_access.carbon b/toolchain/check/testdata/index/fail_tuple_out_of_bound_access.carbon index 43fdda5ca6f3..7a3b91f52023 100644 --- a/toolchain/check/testdata/index/fail_tuple_out_of_bound_access.carbon +++ b/toolchain/check/testdata/index/fail_tuple_out_of_bound_access.carbon @@ -11,23 +11,19 @@ var a: (i32, i32) = (12, 6); var b: i32 = a[2]; // CHECK:STDOUT: file "fail_tuple_out_of_bound_access.carbon" { -// CHECK:STDOUT: %.loc7_9: type = stub_reference i32 -// CHECK:STDOUT: %.loc7_14: type = stub_reference i32 // CHECK:STDOUT: %.loc7_17.1: type = tuple_type (type, type) -// CHECK:STDOUT: %.loc7_17.2: (type, type) = tuple_literal (%.loc7_9, %.loc7_14) +// CHECK:STDOUT: %.loc7_17.2: (type, type) = tuple_literal (i32, i32) // CHECK:STDOUT: %.loc7_17.3: type = tuple_type (i32, i32) // CHECK:STDOUT: %a: ref (i32, i32) = var "a" -// CHECK:STDOUT: %.loc7_22.1: i32 = int_literal 12 -// CHECK:STDOUT: %.loc7_22.2: i32 = stub_reference %.loc7_22.1 -// CHECK:STDOUT: %.loc7_26.1: i32 = int_literal 6 -// CHECK:STDOUT: %.loc7_26.2: i32 = stub_reference %.loc7_26.1 -// CHECK:STDOUT: %.loc7_27: (i32, i32) = tuple_literal (%.loc7_22.2, %.loc7_26.2) +// CHECK:STDOUT: %.loc7_22: i32 = int_literal 12 +// CHECK:STDOUT: %.loc7_26: i32 = int_literal 6 +// CHECK:STDOUT: %.loc7_27: (i32, i32) = tuple_literal (%.loc7_22, %.loc7_26) // CHECK:STDOUT: %.loc7_28.1: i32 = int_literal 0 // CHECK:STDOUT: %.loc7_28.2: ref i32 = tuple_index %a, %.loc7_28.1 -// CHECK:STDOUT: %.loc7_28.3: init i32 = initialize_from %.loc7_22.2 to %.loc7_28.2 +// CHECK:STDOUT: %.loc7_28.3: init i32 = initialize_from %.loc7_22 to %.loc7_28.2 // CHECK:STDOUT: %.loc7_28.4: i32 = int_literal 1 // CHECK:STDOUT: %.loc7_28.5: ref i32 = tuple_index %a, %.loc7_28.4 -// CHECK:STDOUT: %.loc7_28.6: init i32 = initialize_from %.loc7_26.2 to %.loc7_28.5 +// CHECK:STDOUT: %.loc7_28.6: init i32 = initialize_from %.loc7_26 to %.loc7_28.5 // CHECK:STDOUT: %.loc7_28.7: init (i32, i32) = tuple_init %.loc7_27, (%.loc7_28.3, %.loc7_28.6) // CHECK:STDOUT: assign %a, %.loc7_28.7 // CHECK:STDOUT: %b: ref i32 = var "b" diff --git a/toolchain/check/testdata/index/tuple_element_access.carbon b/toolchain/check/testdata/index/tuple_element_access.carbon index f49a7a348220..c20d3f4dfaeb 100644 --- a/toolchain/check/testdata/index/tuple_element_access.carbon +++ b/toolchain/check/testdata/index/tuple_element_access.carbon @@ -9,20 +9,17 @@ var b: (i32,) = a; var c: i32 = b[0]; // CHECK:STDOUT: file "tuple_element_access.carbon" { -// CHECK:STDOUT: %.loc7_9: type = stub_reference i32 // CHECK:STDOUT: %.loc7_13.1: type = tuple_type (type) -// CHECK:STDOUT: %.loc7_13.2: (type,) = tuple_literal (%.loc7_9) +// CHECK:STDOUT: %.loc7_13.2: (type,) = tuple_literal (i32) // CHECK:STDOUT: %.loc7_13.3: type = tuple_type (i32) // CHECK:STDOUT: %a: ref (i32,) = var "a" -// CHECK:STDOUT: %.loc7_18.1: i32 = int_literal 12 -// CHECK:STDOUT: %.loc7_18.2: i32 = stub_reference %.loc7_18.1 -// CHECK:STDOUT: %.loc7_21: (i32,) = tuple_literal (%.loc7_18.2) +// CHECK:STDOUT: %.loc7_18: i32 = int_literal 12 +// CHECK:STDOUT: %.loc7_21: (i32,) = tuple_literal (%.loc7_18) // CHECK:STDOUT: %.loc7_22.1: i32 = int_literal 0 // CHECK:STDOUT: %.loc7_22.2: ref i32 = tuple_index %a, %.loc7_22.1 -// CHECK:STDOUT: %.loc7_22.3: init (i32,) = tuple_init %.loc7_21, (%.loc7_18.2) +// CHECK:STDOUT: %.loc7_22.3: init (i32,) = tuple_init %.loc7_21, (%.loc7_18) // CHECK:STDOUT: assign %a, %.loc7_22.3 -// CHECK:STDOUT: %.loc8_9: type = stub_reference i32 -// CHECK:STDOUT: %.loc8_13: (type,) = tuple_literal (%.loc8_9) +// CHECK:STDOUT: %.loc8: (type,) = tuple_literal (i32) // CHECK:STDOUT: %b: ref (i32,) = var "b" // CHECK:STDOUT: %.loc7_5: (i32,) = bind_value %a // CHECK:STDOUT: assign %b, %.loc7_5 diff --git a/toolchain/check/testdata/index/tuple_return_value_access.carbon b/toolchain/check/testdata/index/tuple_return_value_access.carbon index 23fbbd71bb65..1045368444ca 100644 --- a/toolchain/check/testdata/index/tuple_return_value_access.carbon +++ b/toolchain/check/testdata/index/tuple_return_value_access.carbon @@ -17,10 +17,9 @@ fn Run() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> (i32,) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc7_28.1: i32 = int_literal 0 -// CHECK:STDOUT: %.loc7_28.2: i32 = stub_reference %.loc7_28.1 -// CHECK:STDOUT: %.loc7_30.1: (i32,) = tuple_literal (%.loc7_28.2) -// CHECK:STDOUT: %.loc7_30.2: (i32,) = tuple_value %.loc7_30.1, (%.loc7_28.2) +// CHECK:STDOUT: %.loc7_28: i32 = int_literal 0 +// CHECK:STDOUT: %.loc7_30.1: (i32,) = tuple_literal (%.loc7_28) +// CHECK:STDOUT: %.loc7_30.2: (i32,) = tuple_value %.loc7_30.1, (%.loc7_28) // CHECK:STDOUT: return %.loc7_30.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/assignment.carbon b/toolchain/check/testdata/operators/assignment.carbon index 7b7eed67ceee..45970aa27ee6 100644 --- a/toolchain/check/testdata/operators/assignment.carbon +++ b/toolchain/check/testdata/operators/assignment.carbon @@ -33,23 +33,19 @@ fn Main() { // CHECK:STDOUT: assign %a, %.loc8 // CHECK:STDOUT: %.loc9: i32 = int_literal 9 // CHECK:STDOUT: assign %a, %.loc9 -// CHECK:STDOUT: %.loc11_11: type = stub_reference i32 -// CHECK:STDOUT: %.loc11_16: type = stub_reference i32 // CHECK:STDOUT: %.loc11_19.1: type = tuple_type (type, type) -// CHECK:STDOUT: %.loc11_19.2: (type, type) = tuple_literal (%.loc11_11, %.loc11_16) +// CHECK:STDOUT: %.loc11_19.2: (type, type) = tuple_literal (i32, i32) // CHECK:STDOUT: %.loc11_19.3: type = tuple_type (i32, i32) // CHECK:STDOUT: %b: ref (i32, i32) = var "b" -// CHECK:STDOUT: %.loc11_24.1: i32 = int_literal 1 -// CHECK:STDOUT: %.loc11_24.2: i32 = stub_reference %.loc11_24.1 -// CHECK:STDOUT: %.loc11_27.1: i32 = int_literal 2 -// CHECK:STDOUT: %.loc11_27.2: i32 = stub_reference %.loc11_27.1 -// CHECK:STDOUT: %.loc11_28: (i32, i32) = tuple_literal (%.loc11_24.2, %.loc11_27.2) +// CHECK:STDOUT: %.loc11_24: i32 = int_literal 1 +// CHECK:STDOUT: %.loc11_27: i32 = int_literal 2 +// CHECK:STDOUT: %.loc11_28: (i32, i32) = tuple_literal (%.loc11_24, %.loc11_27) // CHECK:STDOUT: %.loc11_29.1: i32 = int_literal 0 // CHECK:STDOUT: %.loc11_29.2: ref i32 = tuple_index %b, %.loc11_29.1 -// CHECK:STDOUT: %.loc11_29.3: init i32 = initialize_from %.loc11_24.2 to %.loc11_29.2 +// CHECK:STDOUT: %.loc11_29.3: init i32 = initialize_from %.loc11_24 to %.loc11_29.2 // CHECK:STDOUT: %.loc11_29.4: i32 = int_literal 1 // CHECK:STDOUT: %.loc11_29.5: ref i32 = tuple_index %b, %.loc11_29.4 -// CHECK:STDOUT: %.loc11_29.6: init i32 = initialize_from %.loc11_27.2 to %.loc11_29.5 +// CHECK:STDOUT: %.loc11_29.6: init i32 = initialize_from %.loc11_27 to %.loc11_29.5 // CHECK:STDOUT: %.loc11_29.7: init (i32, i32) = tuple_init %.loc11_28, (%.loc11_29.3, %.loc11_29.6) // CHECK:STDOUT: assign %b, %.loc11_29.7 // CHECK:STDOUT: %.loc12_5: i32 = int_literal 0 @@ -63,14 +59,12 @@ fn Main() { // CHECK:STDOUT: %.loc15_27: type = struct_type {.a: i32, .b: i32} // CHECK:STDOUT: %c: ref {.a: i32, .b: i32} = var "c" // CHECK:STDOUT: %.loc15_37: i32 = int_literal 1 -// CHECK:STDOUT: %.loc15_35: i32 = stub_reference %.loc15_37 // CHECK:STDOUT: %.loc15_45: i32 = int_literal 2 -// CHECK:STDOUT: %.loc15_43: i32 = stub_reference %.loc15_45 -// CHECK:STDOUT: %.loc15_46: {.a: i32, .b: i32} = struct_literal (%.loc15_35, %.loc15_43) +// CHECK:STDOUT: %.loc15_46: {.a: i32, .b: i32} = struct_literal (%.loc15_37, %.loc15_45) // CHECK:STDOUT: %.loc15_47.1: ref i32 = struct_access %c, member0 -// CHECK:STDOUT: %.loc15_47.2: init i32 = initialize_from %.loc15_35 to %.loc15_47.1 +// CHECK:STDOUT: %.loc15_47.2: init i32 = initialize_from %.loc15_37 to %.loc15_47.1 // CHECK:STDOUT: %.loc15_47.3: ref i32 = struct_access %c, member1 -// CHECK:STDOUT: %.loc15_47.4: init i32 = initialize_from %.loc15_43 to %.loc15_47.3 +// CHECK:STDOUT: %.loc15_47.4: init i32 = initialize_from %.loc15_45 to %.loc15_47.3 // CHECK:STDOUT: %.loc15_47.5: init {.a: i32, .b: i32} = struct_init %.loc15_46, (%.loc15_47.2, %.loc15_47.4) // CHECK:STDOUT: assign %c, %.loc15_47.5 // CHECK:STDOUT: %.loc16_4: ref i32 = struct_access %c, member0 diff --git a/toolchain/check/testdata/operators/fail_assigment_to_non_assignable.carbon b/toolchain/check/testdata/operators/fail_assigment_to_non_assignable.carbon index 9ee48a350a02..9f8d024c5e0e 100644 --- a/toolchain/check/testdata/operators/fail_assigment_to_non_assignable.carbon +++ b/toolchain/check/testdata/operators/fail_assigment_to_non_assignable.carbon @@ -60,68 +60,56 @@ fn Main() { // CHECK:STDOUT: %.loc17_4: init i32 = call @F() // CHECK:STDOUT: %.loc17_9: i32 = int_literal 1 // CHECK:STDOUT: assign %.loc17_4, %.loc17_9 -// CHECK:STDOUT: %.loc21_4.1: i32 = int_literal 1 -// CHECK:STDOUT: %.loc21_4.2: i32 = stub_reference %.loc21_4.1 -// CHECK:STDOUT: %.loc21_7.1: i32 = int_literal 2 -// CHECK:STDOUT: %.loc21_7.2: i32 = stub_reference %.loc21_7.1 +// CHECK:STDOUT: %.loc21_4: i32 = int_literal 1 +// CHECK:STDOUT: %.loc21_7: i32 = int_literal 2 // CHECK:STDOUT: %.loc21_8.1: type = tuple_type (i32, i32) -// CHECK:STDOUT: %.loc21_8.2: (i32, i32) = tuple_literal (%.loc21_4.2, %.loc21_7.2) -// CHECK:STDOUT: %.loc21_13.1: i32 = int_literal 3 -// CHECK:STDOUT: %.loc21_13.2: i32 = stub_reference %.loc21_13.1 -// CHECK:STDOUT: %.loc21_16.1: i32 = int_literal 4 -// CHECK:STDOUT: %.loc21_16.2: i32 = stub_reference %.loc21_16.1 -// CHECK:STDOUT: %.loc21_17: (i32, i32) = tuple_literal (%.loc21_13.2, %.loc21_16.2) +// CHECK:STDOUT: %.loc21_8.2: (i32, i32) = tuple_literal (%.loc21_4, %.loc21_7) +// CHECK:STDOUT: %.loc21_13: i32 = int_literal 3 +// CHECK:STDOUT: %.loc21_16: i32 = int_literal 4 +// CHECK:STDOUT: %.loc21_17: (i32, i32) = tuple_literal (%.loc21_13, %.loc21_16) // CHECK:STDOUT: %.loc21_10.1: i32 = int_literal 0 // CHECK:STDOUT: %.loc21_10.2: i32 = tuple_index %.loc21_8.2, %.loc21_10.1 -// CHECK:STDOUT: %.loc21_10.3: init i32 = initialize_from %.loc21_13.2 to %.loc21_10.2 +// CHECK:STDOUT: %.loc21_10.3: init i32 = initialize_from %.loc21_13 to %.loc21_10.2 // CHECK:STDOUT: %.loc21_10.4: i32 = int_literal 1 // CHECK:STDOUT: %.loc21_10.5: i32 = tuple_index %.loc21_8.2, %.loc21_10.4 -// CHECK:STDOUT: %.loc21_10.6: init i32 = initialize_from %.loc21_16.2 to %.loc21_10.5 +// CHECK:STDOUT: %.loc21_10.6: init i32 = initialize_from %.loc21_16 to %.loc21_10.5 // CHECK:STDOUT: %.loc21_10.7: init (i32, i32) = tuple_init %.loc21_17, (%.loc21_10.3, %.loc21_10.6) // CHECK:STDOUT: assign %.loc21_8.2, %.loc21_10.7 -// CHECK:STDOUT: %.loc21_8.3: (i32, i32) = tuple_value %.loc21_8.2, (%.loc21_4.2, %.loc21_7.2) +// CHECK:STDOUT: %.loc21_8.3: (i32, i32) = tuple_value %.loc21_8.2, (%.loc21_4, %.loc21_7) // CHECK:STDOUT: %n: ref i32 = var "n" -// CHECK:STDOUT: %.loc22: i32 = int_literal 0 -// CHECK:STDOUT: assign %n, %.loc22 -// CHECK:STDOUT: %.loc26_4.1: ref i32 = stub_reference %n -// CHECK:STDOUT: %.loc26_7.1: ref i32 = stub_reference %n -// CHECK:STDOUT: %.loc26_8.1: (i32, i32) = tuple_literal (%.loc26_4.1, %.loc26_7.1) -// CHECK:STDOUT: %.loc26_13.1: i32 = int_literal 1 -// CHECK:STDOUT: %.loc26_13.2: i32 = stub_reference %.loc26_13.1 -// CHECK:STDOUT: %.loc26_16.1: i32 = int_literal 2 -// CHECK:STDOUT: %.loc26_16.2: i32 = stub_reference %.loc26_16.1 -// CHECK:STDOUT: %.loc26_17: (i32, i32) = tuple_literal (%.loc26_13.2, %.loc26_16.2) +// CHECK:STDOUT: %.loc22_16: i32 = int_literal 0 +// CHECK:STDOUT: assign %n, %.loc22_16 +// CHECK:STDOUT: %.loc26_8.1: (i32, i32) = tuple_literal (%n, %n) +// CHECK:STDOUT: %.loc26_13: i32 = int_literal 1 +// CHECK:STDOUT: %.loc26_16: i32 = int_literal 2 +// CHECK:STDOUT: %.loc26_17: (i32, i32) = tuple_literal (%.loc26_13, %.loc26_16) // CHECK:STDOUT: %.loc26_10.1: i32 = int_literal 0 // CHECK:STDOUT: %.loc26_10.2: i32 = tuple_index %.loc26_8.1, %.loc26_10.1 -// CHECK:STDOUT: %.loc26_10.3: init i32 = initialize_from %.loc26_13.2 to %.loc26_10.2 +// CHECK:STDOUT: %.loc26_10.3: init i32 = initialize_from %.loc26_13 to %.loc26_10.2 // CHECK:STDOUT: %.loc26_10.4: i32 = int_literal 1 // CHECK:STDOUT: %.loc26_10.5: i32 = tuple_index %.loc26_8.1, %.loc26_10.4 -// CHECK:STDOUT: %.loc26_10.6: init i32 = initialize_from %.loc26_16.2 to %.loc26_10.5 +// CHECK:STDOUT: %.loc26_10.6: init i32 = initialize_from %.loc26_16 to %.loc26_10.5 // CHECK:STDOUT: %.loc26_10.7: init (i32, i32) = tuple_init %.loc26_17, (%.loc26_10.3, %.loc26_10.6) // CHECK:STDOUT: assign %.loc26_8.1, %.loc26_10.7 -// CHECK:STDOUT: %.loc26_4.2: i32 = bind_value %.loc26_4.1 -// CHECK:STDOUT: %.loc26_7.2: i32 = bind_value %.loc26_7.1 -// CHECK:STDOUT: %.loc26_8.2: (i32, i32) = tuple_value %.loc26_8.1, (%.loc26_4.2, %.loc26_7.2) +// CHECK:STDOUT: %.loc22_7.1: i32 = bind_value %n +// CHECK:STDOUT: %.loc22_7.2: i32 = bind_value %n +// CHECK:STDOUT: %.loc26_8.2: (i32, i32) = tuple_value %.loc26_8.1, (%.loc22_7.1, %.loc22_7.2) // CHECK:STDOUT: %.loc30: type = ptr_type i32 // CHECK:STDOUT: assign i32, %.loc30 // CHECK:STDOUT: %.loc34_9: i32 = int_literal 1 -// CHECK:STDOUT: %.loc34_7: i32 = stub_reference %.loc34_9 // CHECK:STDOUT: %.loc34_17: i32 = int_literal 2 -// CHECK:STDOUT: %.loc34_15: i32 = stub_reference %.loc34_17 // CHECK:STDOUT: %.loc34_18.1: type = struct_type {.x: i32, .y: i32} -// CHECK:STDOUT: %.loc34_18.2: {.x: i32, .y: i32} = struct_literal (%.loc34_7, %.loc34_15) +// CHECK:STDOUT: %.loc34_18.2: {.x: i32, .y: i32} = struct_literal (%.loc34_9, %.loc34_17) // CHECK:STDOUT: %.loc34_28: i32 = int_literal 3 -// CHECK:STDOUT: %.loc34_26: i32 = stub_reference %.loc34_28 // CHECK:STDOUT: %.loc34_36: i32 = int_literal 4 -// CHECK:STDOUT: %.loc34_34: i32 = stub_reference %.loc34_36 -// CHECK:STDOUT: %.loc34_37: {.x: i32, .y: i32} = struct_literal (%.loc34_26, %.loc34_34) +// CHECK:STDOUT: %.loc34_37: {.x: i32, .y: i32} = struct_literal (%.loc34_28, %.loc34_36) // CHECK:STDOUT: %.loc34_20.1: i32 = struct_access %.loc34_18.2, member0 -// CHECK:STDOUT: %.loc34_20.2: init i32 = initialize_from %.loc34_26 to %.loc34_20.1 +// CHECK:STDOUT: %.loc34_20.2: init i32 = initialize_from %.loc34_28 to %.loc34_20.1 // CHECK:STDOUT: %.loc34_20.3: i32 = struct_access %.loc34_18.2, member1 -// CHECK:STDOUT: %.loc34_20.4: init i32 = initialize_from %.loc34_34 to %.loc34_20.3 +// CHECK:STDOUT: %.loc34_20.4: init i32 = initialize_from %.loc34_36 to %.loc34_20.3 // CHECK:STDOUT: %.loc34_20.5: init {.x: i32, .y: i32} = struct_init %.loc34_37, (%.loc34_20.2, %.loc34_20.4) // CHECK:STDOUT: assign %.loc34_18.2, %.loc34_20.5 -// CHECK:STDOUT: %.loc34_18.3: {.x: i32, .y: i32} = struct_value %.loc34_18.2, (%.loc34_7, %.loc34_15) +// CHECK:STDOUT: %.loc34_18.3: {.x: i32, .y: i32} = struct_value %.loc34_18.2, (%.loc34_9, %.loc34_17) // CHECK:STDOUT: %.loc38_7: bool = bool_literal true // CHECK:STDOUT: if %.loc38_7 br !if.expr.then.loc38 else br !if.expr.else.loc38 // CHECK:STDOUT: diff --git a/toolchain/check/testdata/pointer/address_of_lvalue.carbon b/toolchain/check/testdata/pointer/address_of_lvalue.carbon index a139fef27ace..bf5cc2d039ef 100644 --- a/toolchain/check/testdata/pointer/address_of_lvalue.carbon +++ b/toolchain/check/testdata/pointer/address_of_lvalue.carbon @@ -25,14 +25,12 @@ fn F() { // CHECK:STDOUT: %.loc8_27: type = struct_type {.a: i32, .b: i32} // CHECK:STDOUT: %s: ref {.a: i32, .b: i32} = var "s" // CHECK:STDOUT: %.loc8_37: i32 = int_literal 1 -// CHECK:STDOUT: %.loc8_35: i32 = stub_reference %.loc8_37 // CHECK:STDOUT: %.loc8_45: i32 = int_literal 2 -// CHECK:STDOUT: %.loc8_43: i32 = stub_reference %.loc8_45 -// CHECK:STDOUT: %.loc8_46: {.a: i32, .b: i32} = struct_literal (%.loc8_35, %.loc8_43) +// CHECK:STDOUT: %.loc8_46: {.a: i32, .b: i32} = struct_literal (%.loc8_37, %.loc8_45) // CHECK:STDOUT: %.loc8_47.1: ref i32 = struct_access %s, member0 -// CHECK:STDOUT: %.loc8_47.2: init i32 = initialize_from %.loc8_35 to %.loc8_47.1 +// CHECK:STDOUT: %.loc8_47.2: init i32 = initialize_from %.loc8_37 to %.loc8_47.1 // CHECK:STDOUT: %.loc8_47.3: ref i32 = struct_access %s, member1 -// CHECK:STDOUT: %.loc8_47.4: init i32 = initialize_from %.loc8_43 to %.loc8_47.3 +// CHECK:STDOUT: %.loc8_47.4: init i32 = initialize_from %.loc8_45 to %.loc8_47.3 // CHECK:STDOUT: %.loc8_47.5: init {.a: i32, .b: i32} = struct_init %.loc8_46, (%.loc8_47.2, %.loc8_47.4) // CHECK:STDOUT: assign %s, %.loc8_47.5 // CHECK:STDOUT: %.loc10_27: type = struct_type {.a: i32, .b: i32} @@ -50,23 +48,19 @@ fn F() { // CHECK:STDOUT: %.loc12_19: ref i32 = struct_access %s, member1 // CHECK:STDOUT: %.loc12_17: i32* = address_of %.loc12_19 // CHECK:STDOUT: assign %r, %.loc12_17 -// CHECK:STDOUT: %.loc14_11: type = stub_reference i32 -// CHECK:STDOUT: %.loc14_16: type = stub_reference i32 // CHECK:STDOUT: %.loc14_19.1: type = tuple_type (type, type) -// CHECK:STDOUT: %.loc14_19.2: (type, type) = tuple_literal (%.loc14_11, %.loc14_16) +// CHECK:STDOUT: %.loc14_19.2: (type, type) = tuple_literal (i32, i32) // CHECK:STDOUT: %.loc14_19.3: type = tuple_type (i32, i32) // CHECK:STDOUT: %t: ref (i32, i32) = var "t" -// CHECK:STDOUT: %.loc14_24.1: i32 = int_literal 1 -// CHECK:STDOUT: %.loc14_24.2: i32 = stub_reference %.loc14_24.1 -// CHECK:STDOUT: %.loc14_27.1: i32 = int_literal 2 -// CHECK:STDOUT: %.loc14_27.2: i32 = stub_reference %.loc14_27.1 -// CHECK:STDOUT: %.loc14_28: (i32, i32) = tuple_literal (%.loc14_24.2, %.loc14_27.2) +// CHECK:STDOUT: %.loc14_24: i32 = int_literal 1 +// CHECK:STDOUT: %.loc14_27: i32 = int_literal 2 +// CHECK:STDOUT: %.loc14_28: (i32, i32) = tuple_literal (%.loc14_24, %.loc14_27) // CHECK:STDOUT: %.loc14_29.1: i32 = int_literal 0 // CHECK:STDOUT: %.loc14_29.2: ref i32 = tuple_index %t, %.loc14_29.1 -// CHECK:STDOUT: %.loc14_29.3: init i32 = initialize_from %.loc14_24.2 to %.loc14_29.2 +// CHECK:STDOUT: %.loc14_29.3: init i32 = initialize_from %.loc14_24 to %.loc14_29.2 // CHECK:STDOUT: %.loc14_29.4: i32 = int_literal 1 // CHECK:STDOUT: %.loc14_29.5: ref i32 = tuple_index %t, %.loc14_29.4 -// CHECK:STDOUT: %.loc14_29.6: init i32 = initialize_from %.loc14_27.2 to %.loc14_29.5 +// CHECK:STDOUT: %.loc14_29.6: init i32 = initialize_from %.loc14_27 to %.loc14_29.5 // CHECK:STDOUT: %.loc14_29.7: init (i32, i32) = tuple_init %.loc14_28, (%.loc14_29.3, %.loc14_29.6) // CHECK:STDOUT: assign %t, %.loc14_29.7 // CHECK:STDOUT: %.loc15_14: type = ptr_type i32 diff --git a/toolchain/check/testdata/pointer/fail_address_of_value.carbon b/toolchain/check/testdata/pointer/fail_address_of_value.carbon index e26b08906b32..ed86bdb3efb8 100644 --- a/toolchain/check/testdata/pointer/fail_address_of_value.carbon +++ b/toolchain/check/testdata/pointer/fail_address_of_value.carbon @@ -111,17 +111,14 @@ fn AddressOfParameter(param: i32) { // CHECK:STDOUT: %.loc27_4: String = string_literal "Hello" // CHECK:STDOUT: %.loc27_3.1: type = ptr_type String // CHECK:STDOUT: %.loc27_3.2: String* = address_of %.loc27_4 -// CHECK:STDOUT: %.loc31_5.1: i32 = int_literal 1 -// CHECK:STDOUT: %.loc31_5.2: i32 = stub_reference %.loc31_5.1 -// CHECK:STDOUT: %.loc31_8.1: i32 = int_literal 2 -// CHECK:STDOUT: %.loc31_8.2: i32 = stub_reference %.loc31_8.1 +// CHECK:STDOUT: %.loc31_5: i32 = int_literal 1 +// CHECK:STDOUT: %.loc31_8: i32 = int_literal 2 // CHECK:STDOUT: %.loc31_9.1: type = tuple_type (i32, i32) -// CHECK:STDOUT: %.loc31_9.2: (i32, i32) = tuple_literal (%.loc31_5.2, %.loc31_8.2) +// CHECK:STDOUT: %.loc31_9.2: (i32, i32) = tuple_literal (%.loc31_5, %.loc31_8) // CHECK:STDOUT: %.loc31_3.1: type = ptr_type (i32, i32) // CHECK:STDOUT: %.loc31_3.2: (i32, i32)* = address_of %.loc31_9.2 // CHECK:STDOUT: %.loc35_10: i32 = int_literal 5 -// CHECK:STDOUT: %.loc35_8: i32 = stub_reference %.loc35_10 -// CHECK:STDOUT: %.loc35_11: {.a: i32} = struct_literal (%.loc35_8) +// CHECK:STDOUT: %.loc35_11: {.a: i32} = struct_literal (%.loc35_10) // CHECK:STDOUT: %.loc35_3.1: type = ptr_type {.a: i32} // CHECK:STDOUT: %.loc35_3.2: {.a: i32}* = address_of %.loc35_11 // CHECK:STDOUT: return @@ -163,13 +160,11 @@ fn AddressOfParameter(param: i32) { // CHECK:STDOUT: // CHECK:STDOUT: fn @AddressOfTupleElementValue() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc75_6.1: i32 = int_literal 1 -// CHECK:STDOUT: %.loc75_6.2: i32 = stub_reference %.loc75_6.1 -// CHECK:STDOUT: %.loc75_9.1: i32 = int_literal 2 -// CHECK:STDOUT: %.loc75_9.2: i32 = stub_reference %.loc75_9.1 -// CHECK:STDOUT: %.loc75_10.1: (i32, i32) = tuple_literal (%.loc75_6.2, %.loc75_9.2) +// CHECK:STDOUT: %.loc75_6: i32 = int_literal 1 +// CHECK:STDOUT: %.loc75_9: i32 = int_literal 2 +// CHECK:STDOUT: %.loc75_10.1: (i32, i32) = tuple_literal (%.loc75_6, %.loc75_9) // CHECK:STDOUT: %.loc75_12: i32 = int_literal 0 -// CHECK:STDOUT: %.loc75_10.2: (i32, i32) = tuple_value %.loc75_10.1, (%.loc75_6.2, %.loc75_9.2) +// CHECK:STDOUT: %.loc75_10.2: (i32, i32) = tuple_value %.loc75_10.1, (%.loc75_6, %.loc75_9) // CHECK:STDOUT: %.loc75_13: i32 = tuple_index %.loc75_10.2, %.loc75_12 // CHECK:STDOUT: %.loc75_3: i32* = address_of %.loc75_13 // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/return/struct.carbon b/toolchain/check/testdata/return/struct.carbon index 25243bc9a2ab..669b5dccbfb3 100644 --- a/toolchain/check/testdata/return/struct.carbon +++ b/toolchain/check/testdata/return/struct.carbon @@ -15,8 +15,7 @@ fn Main() -> {.a: i32} { // CHECK:STDOUT: fn @Main() -> {.a: i32} { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc8_16: i32 = int_literal 3 -// CHECK:STDOUT: %.loc8_14: i32 = stub_reference %.loc8_16 -// CHECK:STDOUT: %.loc8_17.1: {.a: i32} = struct_literal (%.loc8_14) -// CHECK:STDOUT: %.loc8_17.2: {.a: i32} = struct_value %.loc8_17.1, (%.loc8_14) +// CHECK:STDOUT: %.loc8_17.1: {.a: i32} = struct_literal (%.loc8_16) +// CHECK:STDOUT: %.loc8_17.2: {.a: i32} = struct_value %.loc8_17.1, (%.loc8_16) // CHECK:STDOUT: return %.loc8_17.2 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/return/tuple.carbon b/toolchain/check/testdata/return/tuple.carbon index 41583c00aa6a..64c44eb2b917 100644 --- a/toolchain/check/testdata/return/tuple.carbon +++ b/toolchain/check/testdata/return/tuple.carbon @@ -15,17 +15,15 @@ fn Main() -> (i32, i32) { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() -> %return: (i32, i32) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc9_11.1: i32 = int_literal 15 -// CHECK:STDOUT: %.loc9_11.2: i32 = stub_reference %.loc9_11.1 -// CHECK:STDOUT: %.loc9_15.1: i32 = int_literal 35 -// CHECK:STDOUT: %.loc9_15.2: i32 = stub_reference %.loc9_15.1 -// CHECK:STDOUT: %.loc9_17: (i32, i32) = tuple_literal (%.loc9_11.2, %.loc9_15.2) +// CHECK:STDOUT: %.loc9_11: i32 = int_literal 15 +// CHECK:STDOUT: %.loc9_15: i32 = int_literal 35 +// CHECK:STDOUT: %.loc9_17: (i32, i32) = tuple_literal (%.loc9_11, %.loc9_15) // CHECK:STDOUT: %.loc9_18.1: i32 = int_literal 0 // CHECK:STDOUT: %.loc9_18.2: ref i32 = tuple_index %return, %.loc9_18.1 -// CHECK:STDOUT: %.loc9_18.3: init i32 = initialize_from %.loc9_11.2 to %.loc9_18.2 +// CHECK:STDOUT: %.loc9_18.3: init i32 = initialize_from %.loc9_11 to %.loc9_18.2 // CHECK:STDOUT: %.loc9_18.4: i32 = int_literal 1 // CHECK:STDOUT: %.loc9_18.5: ref i32 = tuple_index %return, %.loc9_18.4 -// CHECK:STDOUT: %.loc9_18.6: init i32 = initialize_from %.loc9_15.2 to %.loc9_18.5 +// CHECK:STDOUT: %.loc9_18.6: init i32 = initialize_from %.loc9_15 to %.loc9_18.5 // CHECK:STDOUT: %.loc9_18.7: init (i32, i32) = tuple_init %.loc9_17, (%.loc9_18.3, %.loc9_18.6) // CHECK:STDOUT: return %.loc9_18.7 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/fail_assign_nested.carbon b/toolchain/check/testdata/struct/fail_assign_nested.carbon index c1703a2b6575..d371052d1ace 100644 --- a/toolchain/check/testdata/struct/fail_assign_nested.carbon +++ b/toolchain/check/testdata/struct/fail_assign_nested.carbon @@ -15,8 +15,7 @@ var x: {.a: {}} = {.b = {}}; // CHECK:STDOUT: %.loc10_15: type = struct_type {.a: {}} // CHECK:STDOUT: %x: ref {.a: {}} = var "x" // CHECK:STDOUT: %.loc10_26: {} = struct_literal () -// CHECK:STDOUT: %.loc10_23: {} = stub_reference %.loc10_26 // CHECK:STDOUT: %.loc10_27.1: type = struct_type {.b: {}} -// CHECK:STDOUT: %.loc10_27.2: {.b: {}} = struct_literal (%.loc10_23) +// CHECK:STDOUT: %.loc10_27.2: {.b: {}} = struct_literal (%.loc10_26) // CHECK:STDOUT: assign %x, // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/fail_assign_to_empty.carbon b/toolchain/check/testdata/struct/fail_assign_to_empty.carbon index 71bb20a19873..62d96bdee7a5 100644 --- a/toolchain/check/testdata/struct/fail_assign_to_empty.carbon +++ b/toolchain/check/testdata/struct/fail_assign_to_empty.carbon @@ -14,8 +14,7 @@ var x: {} = {.a = 1}; // CHECK:STDOUT: %.loc10_9.2: {} = struct_literal () // CHECK:STDOUT: %x: ref {} = var "x" // CHECK:STDOUT: %.loc10_19: i32 = int_literal 1 -// CHECK:STDOUT: %.loc10_17: i32 = stub_reference %.loc10_19 // CHECK:STDOUT: %.loc10_20.1: type = struct_type {.a: i32} -// CHECK:STDOUT: %.loc10_20.2: {.a: i32} = struct_literal (%.loc10_17) +// CHECK:STDOUT: %.loc10_20.2: {.a: i32} = struct_literal (%.loc10_19) // CHECK:STDOUT: assign %x, // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/fail_field_name_mismatch.carbon b/toolchain/check/testdata/struct/fail_field_name_mismatch.carbon index 73a5ad9c3cd6..301c0ab63ab4 100644 --- a/toolchain/check/testdata/struct/fail_field_name_mismatch.carbon +++ b/toolchain/check/testdata/struct/fail_field_name_mismatch.carbon @@ -13,8 +13,7 @@ var x: {.a: i32} = {.b = 1}; // CHECK:STDOUT: %.loc10_16: type = struct_type {.a: i32} // CHECK:STDOUT: %x: ref {.a: i32} = var "x" // CHECK:STDOUT: %.loc10_26: i32 = int_literal 1 -// CHECK:STDOUT: %.loc10_24: i32 = stub_reference %.loc10_26 // CHECK:STDOUT: %.loc10_27.1: type = struct_type {.b: i32} -// CHECK:STDOUT: %.loc10_27.2: {.b: i32} = struct_literal (%.loc10_24) +// CHECK:STDOUT: %.loc10_27.2: {.b: i32} = struct_literal (%.loc10_26) // CHECK:STDOUT: assign %x, // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/fail_field_type_mismatch.carbon b/toolchain/check/testdata/struct/fail_field_type_mismatch.carbon index e943823f819d..2d11714c7e97 100644 --- a/toolchain/check/testdata/struct/fail_field_type_mismatch.carbon +++ b/toolchain/check/testdata/struct/fail_field_type_mismatch.carbon @@ -13,8 +13,7 @@ var x: {.a: i32} = {.b = 1.0}; // CHECK:STDOUT: %.loc10_16: type = struct_type {.a: i32} // CHECK:STDOUT: %x: ref {.a: i32} = var "x" // CHECK:STDOUT: %.loc10_26: f64 = real_literal 10e-1 -// CHECK:STDOUT: %.loc10_24: f64 = stub_reference %.loc10_26 // CHECK:STDOUT: %.loc10_29.1: type = struct_type {.b: f64} -// CHECK:STDOUT: %.loc10_29.2: {.b: f64} = struct_literal (%.loc10_24) +// CHECK:STDOUT: %.loc10_29.2: {.b: f64} = struct_literal (%.loc10_26) // CHECK:STDOUT: assign %x, // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/fail_member_access_type.carbon b/toolchain/check/testdata/struct/fail_member_access_type.carbon index 288e3204d130..3ddfe37b1b08 100644 --- a/toolchain/check/testdata/struct/fail_member_access_type.carbon +++ b/toolchain/check/testdata/struct/fail_member_access_type.carbon @@ -14,10 +14,9 @@ var y: i32 = x.b; // CHECK:STDOUT: %.loc7_16: type = struct_type {.a: f64} // CHECK:STDOUT: %x: ref {.a: f64} = var "x" // CHECK:STDOUT: %.loc7_26: f64 = real_literal 40e-1 -// CHECK:STDOUT: %.loc7_24: f64 = stub_reference %.loc7_26 -// CHECK:STDOUT: %.loc7_29: {.a: f64} = struct_literal (%.loc7_24) +// CHECK:STDOUT: %.loc7_29: {.a: f64} = struct_literal (%.loc7_26) // CHECK:STDOUT: %.loc7_30.1: ref f64 = struct_access %x, member0 -// CHECK:STDOUT: %.loc7_30.2: init {.a: f64} = struct_init %.loc7_29, (%.loc7_24) +// CHECK:STDOUT: %.loc7_30.2: init {.a: f64} = struct_init %.loc7_29, (%.loc7_26) // CHECK:STDOUT: assign %x, %.loc7_30.2 // CHECK:STDOUT: %y: ref i32 = var "y" // CHECK:STDOUT: assign %y, diff --git a/toolchain/check/testdata/struct/fail_non_member_access.carbon b/toolchain/check/testdata/struct/fail_non_member_access.carbon index 6775e8ef01cf..5ac9fbd6add0 100644 --- a/toolchain/check/testdata/struct/fail_non_member_access.carbon +++ b/toolchain/check/testdata/struct/fail_non_member_access.carbon @@ -14,10 +14,9 @@ var y: i32 = x.b; // CHECK:STDOUT: %.loc7_16: type = struct_type {.a: i32} // CHECK:STDOUT: %x: ref {.a: i32} = var "x" // CHECK:STDOUT: %.loc7_26: i32 = int_literal 4 -// CHECK:STDOUT: %.loc7_24: i32 = stub_reference %.loc7_26 -// CHECK:STDOUT: %.loc7_27: {.a: i32} = struct_literal (%.loc7_24) +// CHECK:STDOUT: %.loc7_27: {.a: i32} = struct_literal (%.loc7_26) // CHECK:STDOUT: %.loc7_28.1: ref i32 = struct_access %x, member0 -// CHECK:STDOUT: %.loc7_28.2: init {.a: i32} = struct_init %.loc7_27, (%.loc7_24) +// CHECK:STDOUT: %.loc7_28.2: init {.a: i32} = struct_init %.loc7_27, (%.loc7_26) // CHECK:STDOUT: assign %x, %.loc7_28.2 // CHECK:STDOUT: %y: ref i32 = var "y" // CHECK:STDOUT: assign %y, diff --git a/toolchain/check/testdata/struct/fail_too_few_values.carbon b/toolchain/check/testdata/struct/fail_too_few_values.carbon index 78fefe58f479..48357aadd497 100644 --- a/toolchain/check/testdata/struct/fail_too_few_values.carbon +++ b/toolchain/check/testdata/struct/fail_too_few_values.carbon @@ -13,8 +13,7 @@ var x: {.a: i32, .b: i32} = {.a = 1}; // CHECK:STDOUT: %.loc10_25: type = struct_type {.a: i32, .b: i32} // CHECK:STDOUT: %x: ref {.a: i32, .b: i32} = var "x" // CHECK:STDOUT: %.loc10_35: i32 = int_literal 1 -// CHECK:STDOUT: %.loc10_33: i32 = stub_reference %.loc10_35 // CHECK:STDOUT: %.loc10_36.1: type = struct_type {.a: i32} -// CHECK:STDOUT: %.loc10_36.2: {.a: i32} = struct_literal (%.loc10_33) +// CHECK:STDOUT: %.loc10_36.2: {.a: i32} = struct_literal (%.loc10_35) // CHECK:STDOUT: assign %x, // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/fail_value_as_type.carbon b/toolchain/check/testdata/struct/fail_value_as_type.carbon index 9bd2037ca22b..4465ea91bd38 100644 --- a/toolchain/check/testdata/struct/fail_value_as_type.carbon +++ b/toolchain/check/testdata/struct/fail_value_as_type.carbon @@ -11,8 +11,7 @@ var x: {.a = 1}; // CHECK:STDOUT: file "fail_value_as_type.carbon" { // CHECK:STDOUT: %.loc10_14: i32 = int_literal 1 -// CHECK:STDOUT: %.loc10_12: i32 = stub_reference %.loc10_14 // CHECK:STDOUT: %.loc10_15.1: type = struct_type {.a: i32} -// CHECK:STDOUT: %.loc10_15.2: {.a: i32} = struct_literal (%.loc10_12) +// CHECK:STDOUT: %.loc10_15.2: {.a: i32} = struct_literal (%.loc10_14) // CHECK:STDOUT: %x: ref = var "x" // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/member_access.carbon b/toolchain/check/testdata/struct/member_access.carbon index 8ac94f05d011..75eed1388cf3 100644 --- a/toolchain/check/testdata/struct/member_access.carbon +++ b/toolchain/check/testdata/struct/member_access.carbon @@ -12,14 +12,12 @@ var z: i32 = y; // CHECK:STDOUT: %.loc7_25: type = struct_type {.a: f64, .b: i32} // CHECK:STDOUT: %x: ref {.a: f64, .b: i32} = var "x" // CHECK:STDOUT: %.loc7_35: f64 = real_literal 0e-1 -// CHECK:STDOUT: %.loc7_33: f64 = stub_reference %.loc7_35 // CHECK:STDOUT: %.loc7_45: i32 = int_literal 1 -// CHECK:STDOUT: %.loc7_43: i32 = stub_reference %.loc7_45 -// CHECK:STDOUT: %.loc7_46: {.a: f64, .b: i32} = struct_literal (%.loc7_33, %.loc7_43) +// CHECK:STDOUT: %.loc7_46: {.a: f64, .b: i32} = struct_literal (%.loc7_35, %.loc7_45) // CHECK:STDOUT: %.loc7_47.1: ref f64 = struct_access %x, member0 -// CHECK:STDOUT: %.loc7_47.2: init f64 = initialize_from %.loc7_33 to %.loc7_47.1 +// CHECK:STDOUT: %.loc7_47.2: init f64 = initialize_from %.loc7_35 to %.loc7_47.1 // CHECK:STDOUT: %.loc7_47.3: ref i32 = struct_access %x, member1 -// CHECK:STDOUT: %.loc7_47.4: init i32 = initialize_from %.loc7_43 to %.loc7_47.3 +// CHECK:STDOUT: %.loc7_47.4: init i32 = initialize_from %.loc7_45 to %.loc7_47.3 // CHECK:STDOUT: %.loc7_47.5: init {.a: f64, .b: i32} = struct_init %.loc7_46, (%.loc7_47.2, %.loc7_47.4) // CHECK:STDOUT: assign %x, %.loc7_47.5 // CHECK:STDOUT: %y: ref i32 = var "y" diff --git a/toolchain/check/testdata/struct/one_entry.carbon b/toolchain/check/testdata/struct/one_entry.carbon index fdac1ce3283b..d68296c174f8 100644 --- a/toolchain/check/testdata/struct/one_entry.carbon +++ b/toolchain/check/testdata/struct/one_entry.carbon @@ -11,10 +11,9 @@ var y: {.a: i32} = x; // CHECK:STDOUT: %.loc7_16: type = struct_type {.a: i32} // CHECK:STDOUT: %x: ref {.a: i32} = var "x" // CHECK:STDOUT: %.loc7_26: i32 = int_literal 4 -// CHECK:STDOUT: %.loc7_24: i32 = stub_reference %.loc7_26 -// CHECK:STDOUT: %.loc7_27: {.a: i32} = struct_literal (%.loc7_24) +// CHECK:STDOUT: %.loc7_27: {.a: i32} = struct_literal (%.loc7_26) // CHECK:STDOUT: %.loc7_28.1: ref i32 = struct_access %x, member0 -// CHECK:STDOUT: %.loc7_28.2: init {.a: i32} = struct_init %.loc7_27, (%.loc7_24) +// CHECK:STDOUT: %.loc7_28.2: init {.a: i32} = struct_init %.loc7_27, (%.loc7_26) // CHECK:STDOUT: assign %x, %.loc7_28.2 // CHECK:STDOUT: %.loc8: type = struct_type {.a: i32} // CHECK:STDOUT: %y: ref {.a: i32} = var "y" diff --git a/toolchain/check/testdata/struct/tuple_as_element.carbon b/toolchain/check/testdata/struct/tuple_as_element.carbon index 8995965a375e..83a0d47b27b5 100644 --- a/toolchain/check/testdata/struct/tuple_as_element.carbon +++ b/toolchain/check/testdata/struct/tuple_as_element.carbon @@ -8,30 +8,25 @@ var x: {.a: i32, .b: (i32,)} = {.a = 1, .b = (2,)}; var y: {.a: i32, .b: (i32,)} = x; // CHECK:STDOUT: file "tuple_as_element.carbon" { -// CHECK:STDOUT: %.loc7_23: type = stub_reference i32 // CHECK:STDOUT: %.loc7_27.1: type = tuple_type (type) -// CHECK:STDOUT: %.loc7_27.2: (type,) = tuple_literal (%.loc7_23) +// CHECK:STDOUT: %.loc7_27.2: (type,) = tuple_literal (i32) // CHECK:STDOUT: %.loc7_27.3: type = tuple_type (i32) // CHECK:STDOUT: %.loc7_28: type = struct_type {.a: i32, .b: (i32,)} // CHECK:STDOUT: %x: ref {.a: i32, .b: (i32,)} = var "x" // CHECK:STDOUT: %.loc7_38: i32 = int_literal 1 -// CHECK:STDOUT: %.loc7_36: i32 = stub_reference %.loc7_38 -// CHECK:STDOUT: %.loc7_47.1: i32 = int_literal 2 -// CHECK:STDOUT: %.loc7_47.2: i32 = stub_reference %.loc7_47.1 -// CHECK:STDOUT: %.loc7_49: (i32,) = tuple_literal (%.loc7_47.2) -// CHECK:STDOUT: %.loc7_44: (i32,) = stub_reference %.loc7_49 -// CHECK:STDOUT: %.loc7_50: {.a: i32, .b: (i32,)} = struct_literal (%.loc7_36, %.loc7_44) +// CHECK:STDOUT: %.loc7_47: i32 = int_literal 2 +// CHECK:STDOUT: %.loc7_49: (i32,) = tuple_literal (%.loc7_47) +// CHECK:STDOUT: %.loc7_50: {.a: i32, .b: (i32,)} = struct_literal (%.loc7_38, %.loc7_49) // CHECK:STDOUT: %.loc7_51.1: ref i32 = struct_access %x, member0 -// CHECK:STDOUT: %.loc7_51.2: init i32 = initialize_from %.loc7_36 to %.loc7_51.1 +// CHECK:STDOUT: %.loc7_51.2: init i32 = initialize_from %.loc7_38 to %.loc7_51.1 // CHECK:STDOUT: %.loc7_51.3: ref (i32,) = struct_access %x, member1 // CHECK:STDOUT: %.loc7_51.4: i32 = int_literal 0 // CHECK:STDOUT: %.loc7_51.5: ref i32 = tuple_index %.loc7_51.3, %.loc7_51.4 -// CHECK:STDOUT: %.loc7_51.6: init (i32,) = tuple_init %.loc7_49, (%.loc7_47.2) +// CHECK:STDOUT: %.loc7_51.6: init (i32,) = tuple_init %.loc7_49, (%.loc7_47) // CHECK:STDOUT: %.loc7_51.7: init (i32,) = initialize_from %.loc7_51.6 to %.loc7_51.3 // CHECK:STDOUT: %.loc7_51.8: init {.a: i32, .b: (i32,)} = struct_init %.loc7_50, (%.loc7_51.2, %.loc7_51.7) // CHECK:STDOUT: assign %x, %.loc7_51.8 -// CHECK:STDOUT: %.loc8_23: type = stub_reference i32 -// CHECK:STDOUT: %.loc8_27: (type,) = tuple_literal (%.loc8_23) +// CHECK:STDOUT: %.loc8_27: (type,) = tuple_literal (i32) // CHECK:STDOUT: %.loc8_28: type = struct_type {.a: i32, .b: (i32,)} // CHECK:STDOUT: %y: ref {.a: i32, .b: (i32,)} = var "y" // CHECK:STDOUT: %.loc7_5: {.a: i32, .b: (i32,)} = bind_value %x diff --git a/toolchain/check/testdata/struct/two_entries.carbon b/toolchain/check/testdata/struct/two_entries.carbon index b761a251256c..b368aae0a62b 100644 --- a/toolchain/check/testdata/struct/two_entries.carbon +++ b/toolchain/check/testdata/struct/two_entries.carbon @@ -11,14 +11,12 @@ var y: {.a: i32, .b: i32} = x; // CHECK:STDOUT: %.loc7_25: type = struct_type {.a: i32, .b: i32} // CHECK:STDOUT: %x: ref {.a: i32, .b: i32} = var "x" // CHECK:STDOUT: %.loc7_35: i32 = int_literal 1 -// CHECK:STDOUT: %.loc7_33: i32 = stub_reference %.loc7_35 // CHECK:STDOUT: %.loc7_43: i32 = int_literal 2 -// CHECK:STDOUT: %.loc7_41: i32 = stub_reference %.loc7_43 -// CHECK:STDOUT: %.loc7_44: {.a: i32, .b: i32} = struct_literal (%.loc7_33, %.loc7_41) +// CHECK:STDOUT: %.loc7_44: {.a: i32, .b: i32} = struct_literal (%.loc7_35, %.loc7_43) // CHECK:STDOUT: %.loc7_45.1: ref i32 = struct_access %x, member0 -// CHECK:STDOUT: %.loc7_45.2: init i32 = initialize_from %.loc7_33 to %.loc7_45.1 +// CHECK:STDOUT: %.loc7_45.2: init i32 = initialize_from %.loc7_35 to %.loc7_45.1 // CHECK:STDOUT: %.loc7_45.3: ref i32 = struct_access %x, member1 -// CHECK:STDOUT: %.loc7_45.4: init i32 = initialize_from %.loc7_41 to %.loc7_45.3 +// CHECK:STDOUT: %.loc7_45.4: init i32 = initialize_from %.loc7_43 to %.loc7_45.3 // CHECK:STDOUT: %.loc7_45.5: init {.a: i32, .b: i32} = struct_init %.loc7_44, (%.loc7_45.2, %.loc7_45.4) // CHECK:STDOUT: assign %x, %.loc7_45.5 // CHECK:STDOUT: %.loc8: type = struct_type {.a: i32, .b: i32} diff --git a/toolchain/check/testdata/tuples/fail_assign_empty.carbon b/toolchain/check/testdata/tuples/fail_assign_empty.carbon index 879d92aad88e..29b9b12a2ed8 100644 --- a/toolchain/check/testdata/tuples/fail_assign_empty.carbon +++ b/toolchain/check/testdata/tuples/fail_assign_empty.carbon @@ -10,9 +10,8 @@ var x: (i32,) = (); // CHECK:STDOUT: file "fail_assign_empty.carbon" { -// CHECK:STDOUT: %.loc10_9: type = stub_reference i32 // CHECK:STDOUT: %.loc10_13.1: type = tuple_type (type) -// CHECK:STDOUT: %.loc10_13.2: (type,) = tuple_literal (%.loc10_9) +// CHECK:STDOUT: %.loc10_13.2: (type,) = tuple_literal (i32) // CHECK:STDOUT: %.loc10_13.3: type = tuple_type (i32) // CHECK:STDOUT: %x: ref (i32,) = var "x" // CHECK:STDOUT: %.loc10_18.1: type = tuple_type () diff --git a/toolchain/check/testdata/tuples/fail_assign_nested.carbon b/toolchain/check/testdata/tuples/fail_assign_nested.carbon index ae5625383714..b7c809589e93 100644 --- a/toolchain/check/testdata/tuples/fail_assign_nested.carbon +++ b/toolchain/check/testdata/tuples/fail_assign_nested.carbon @@ -10,38 +10,24 @@ var x: ((i32, i32), (i32, i32)) = ((1, 2, 3), (4, 5, 6)); // CHECK:STDOUT: file "fail_assign_nested.carbon" { -// CHECK:STDOUT: %.loc10_10: type = stub_reference i32 -// CHECK:STDOUT: %.loc10_15: type = stub_reference i32 // CHECK:STDOUT: %.loc10_18.1: type = tuple_type (type, type) -// CHECK:STDOUT: %.loc10_18.2: (type, type) = tuple_literal (%.loc10_10, %.loc10_15) -// CHECK:STDOUT: %.loc10_18.3: (type, type) = stub_reference %.loc10_18.2 -// CHECK:STDOUT: %.loc10_22: type = stub_reference i32 -// CHECK:STDOUT: %.loc10_27: type = stub_reference i32 -// CHECK:STDOUT: %.loc10_30.1: (type, type) = tuple_literal (%.loc10_22, %.loc10_27) -// CHECK:STDOUT: %.loc10_30.2: (type, type) = stub_reference %.loc10_30.1 +// CHECK:STDOUT: %.loc10_18.2: (type, type) = tuple_literal (i32, i32) +// CHECK:STDOUT: %.loc10_30: (type, type) = tuple_literal (i32, i32) // CHECK:STDOUT: %.loc10_31.1: type = tuple_type ((type, type), (type, type)) -// CHECK:STDOUT: %.loc10_31.2: ((type, type), (type, type)) = tuple_literal (%.loc10_18.3, %.loc10_30.2) -// CHECK:STDOUT: %.loc10_18.4: type = tuple_type (i32, i32) +// CHECK:STDOUT: %.loc10_31.2: ((type, type), (type, type)) = tuple_literal (%.loc10_18.2, %.loc10_30) +// CHECK:STDOUT: %.loc10_18.3: type = tuple_type (i32, i32) // CHECK:STDOUT: %.loc10_31.3: type = tuple_type ((i32, i32), (i32, i32)) // CHECK:STDOUT: %x: ref ((i32, i32), (i32, i32)) = var "x" -// CHECK:STDOUT: %.loc10_37.1: i32 = int_literal 1 -// CHECK:STDOUT: %.loc10_37.2: i32 = stub_reference %.loc10_37.1 -// CHECK:STDOUT: %.loc10_40.1: i32 = int_literal 2 -// CHECK:STDOUT: %.loc10_40.2: i32 = stub_reference %.loc10_40.1 -// CHECK:STDOUT: %.loc10_43.1: i32 = int_literal 3 -// CHECK:STDOUT: %.loc10_43.2: i32 = stub_reference %.loc10_43.1 +// CHECK:STDOUT: %.loc10_37: i32 = int_literal 1 +// CHECK:STDOUT: %.loc10_40: i32 = int_literal 2 +// CHECK:STDOUT: %.loc10_43: i32 = int_literal 3 // CHECK:STDOUT: %.loc10_44.1: type = tuple_type (i32, i32, i32) -// CHECK:STDOUT: %.loc10_44.2: (i32, i32, i32) = tuple_literal (%.loc10_37.2, %.loc10_40.2, %.loc10_43.2) -// CHECK:STDOUT: %.loc10_44.3: (i32, i32, i32) = stub_reference %.loc10_44.2 -// CHECK:STDOUT: %.loc10_48.1: i32 = int_literal 4 -// CHECK:STDOUT: %.loc10_48.2: i32 = stub_reference %.loc10_48.1 -// CHECK:STDOUT: %.loc10_51.1: i32 = int_literal 5 -// CHECK:STDOUT: %.loc10_51.2: i32 = stub_reference %.loc10_51.1 -// CHECK:STDOUT: %.loc10_54.1: i32 = int_literal 6 -// CHECK:STDOUT: %.loc10_54.2: i32 = stub_reference %.loc10_54.1 -// CHECK:STDOUT: %.loc10_55.1: (i32, i32, i32) = tuple_literal (%.loc10_48.2, %.loc10_51.2, %.loc10_54.2) -// CHECK:STDOUT: %.loc10_55.2: (i32, i32, i32) = stub_reference %.loc10_55.1 +// CHECK:STDOUT: %.loc10_44.2: (i32, i32, i32) = tuple_literal (%.loc10_37, %.loc10_40, %.loc10_43) +// CHECK:STDOUT: %.loc10_48: i32 = int_literal 4 +// CHECK:STDOUT: %.loc10_51: i32 = int_literal 5 +// CHECK:STDOUT: %.loc10_54: i32 = int_literal 6 +// CHECK:STDOUT: %.loc10_55: (i32, i32, i32) = tuple_literal (%.loc10_48, %.loc10_51, %.loc10_54) // CHECK:STDOUT: %.loc10_56.1: type = tuple_type ((i32, i32, i32), (i32, i32, i32)) -// CHECK:STDOUT: %.loc10_56.2: ((i32, i32, i32), (i32, i32, i32)) = tuple_literal (%.loc10_44.3, %.loc10_55.2) +// CHECK:STDOUT: %.loc10_56.2: ((i32, i32, i32), (i32, i32, i32)) = tuple_literal (%.loc10_44.2, %.loc10_55) // CHECK:STDOUT: assign %x, // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuples/fail_element_type_mismatch.carbon b/toolchain/check/testdata/tuples/fail_element_type_mismatch.carbon index f80a7b6c3e9e..cf52153d8c92 100644 --- a/toolchain/check/testdata/tuples/fail_element_type_mismatch.carbon +++ b/toolchain/check/testdata/tuples/fail_element_type_mismatch.carbon @@ -10,17 +10,13 @@ var x: (i32, i32) = (2, 65.89); // CHECK:STDOUT: file "fail_element_type_mismatch.carbon" { -// CHECK:STDOUT: %.loc10_9: type = stub_reference i32 -// CHECK:STDOUT: %.loc10_14: type = stub_reference i32 // CHECK:STDOUT: %.loc10_17.1: type = tuple_type (type, type) -// CHECK:STDOUT: %.loc10_17.2: (type, type) = tuple_literal (%.loc10_9, %.loc10_14) +// CHECK:STDOUT: %.loc10_17.2: (type, type) = tuple_literal (i32, i32) // CHECK:STDOUT: %.loc10_17.3: type = tuple_type (i32, i32) // CHECK:STDOUT: %x: ref (i32, i32) = var "x" -// CHECK:STDOUT: %.loc10_22.1: i32 = int_literal 2 -// CHECK:STDOUT: %.loc10_22.2: i32 = stub_reference %.loc10_22.1 -// CHECK:STDOUT: %.loc10_25.1: f64 = real_literal 6589e-2 -// CHECK:STDOUT: %.loc10_25.2: f64 = stub_reference %.loc10_25.1 +// CHECK:STDOUT: %.loc10_22: i32 = int_literal 2 +// CHECK:STDOUT: %.loc10_25: f64 = real_literal 6589e-2 // CHECK:STDOUT: %.loc10_30.1: type = tuple_type (i32, f64) -// CHECK:STDOUT: %.loc10_30.2: (i32, f64) = tuple_literal (%.loc10_22.2, %.loc10_25.2) +// CHECK:STDOUT: %.loc10_30.2: (i32, f64) = tuple_literal (%.loc10_22, %.loc10_25) // CHECK:STDOUT: assign %x, // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuples/fail_too_few_element.carbon b/toolchain/check/testdata/tuples/fail_too_few_element.carbon index ddb3709dc81a..781304908c7c 100644 --- a/toolchain/check/testdata/tuples/fail_too_few_element.carbon +++ b/toolchain/check/testdata/tuples/fail_too_few_element.carbon @@ -10,15 +10,12 @@ var x: (i32, i32) = (2, ); // CHECK:STDOUT: file "fail_too_few_element.carbon" { -// CHECK:STDOUT: %.loc10_9: type = stub_reference i32 -// CHECK:STDOUT: %.loc10_14: type = stub_reference i32 // CHECK:STDOUT: %.loc10_17.1: type = tuple_type (type, type) -// CHECK:STDOUT: %.loc10_17.2: (type, type) = tuple_literal (%.loc10_9, %.loc10_14) +// CHECK:STDOUT: %.loc10_17.2: (type, type) = tuple_literal (i32, i32) // CHECK:STDOUT: %.loc10_17.3: type = tuple_type (i32, i32) // CHECK:STDOUT: %x: ref (i32, i32) = var "x" -// CHECK:STDOUT: %.loc10_22.1: i32 = int_literal 2 -// CHECK:STDOUT: %.loc10_22.2: i32 = stub_reference %.loc10_22.1 +// CHECK:STDOUT: %.loc10_22: i32 = int_literal 2 // CHECK:STDOUT: %.loc10_25.1: type = tuple_type (i32) -// CHECK:STDOUT: %.loc10_25.2: (i32,) = tuple_literal (%.loc10_22.2) +// CHECK:STDOUT: %.loc10_25.2: (i32,) = tuple_literal (%.loc10_22) // CHECK:STDOUT: assign %x, // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuples/fail_type_assign.carbon b/toolchain/check/testdata/tuples/fail_type_assign.carbon index 1c1f4c583bd7..02aaeebb4325 100644 --- a/toolchain/check/testdata/tuples/fail_type_assign.carbon +++ b/toolchain/check/testdata/tuples/fail_type_assign.carbon @@ -10,12 +10,10 @@ var x: (i32, ) = (i32, ); // CHECK:STDOUT: file "fail_type_assign.carbon" { -// CHECK:STDOUT: %.loc10_9: type = stub_reference i32 // CHECK:STDOUT: %.loc10_14.1: type = tuple_type (type) -// CHECK:STDOUT: %.loc10_14.2: (type,) = tuple_literal (%.loc10_9) +// CHECK:STDOUT: %.loc10_14.2: (type,) = tuple_literal (i32) // CHECK:STDOUT: %.loc10_14.3: type = tuple_type (i32) // CHECK:STDOUT: %x: ref (i32,) = var "x" -// CHECK:STDOUT: %.loc10_19: type = stub_reference i32 -// CHECK:STDOUT: %.loc10_24: (type,) = tuple_literal (%.loc10_19) +// CHECK:STDOUT: %.loc10_24: (type,) = tuple_literal (i32) // CHECK:STDOUT: assign %x, // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuples/fail_value_as_type.carbon b/toolchain/check/testdata/tuples/fail_value_as_type.carbon index e2dbf642eeb1..56763f89e5d8 100644 --- a/toolchain/check/testdata/tuples/fail_value_as_type.carbon +++ b/toolchain/check/testdata/tuples/fail_value_as_type.carbon @@ -10,10 +10,9 @@ var x: (1, ); // CHECK:STDOUT: file "fail_value_as_type.carbon" { -// CHECK:STDOUT: %.loc10_9.1: i32 = int_literal 1 -// CHECK:STDOUT: %.loc10_9.2: i32 = stub_reference %.loc10_9.1 +// CHECK:STDOUT: %.loc10_9: i32 = int_literal 1 // CHECK:STDOUT: %.loc10_12.1: type = tuple_type (i32) -// CHECK:STDOUT: %.loc10_12.2: (i32,) = tuple_literal (%.loc10_9.2) +// CHECK:STDOUT: %.loc10_12.2: (i32,) = tuple_literal (%.loc10_9) // CHECK:STDOUT: %.loc10_12.3: type = tuple_type () // CHECK:STDOUT: %x: ref (,) = var "x" // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuples/nested_tuple.carbon b/toolchain/check/testdata/tuples/nested_tuple.carbon index eac7812f337c..fc8f42a43edc 100644 --- a/toolchain/check/testdata/tuples/nested_tuple.carbon +++ b/toolchain/check/testdata/tuples/nested_tuple.carbon @@ -7,38 +7,30 @@ var x: ((i32, i32), i32) = ((12, 76), 6); // CHECK:STDOUT: file "nested_tuple.carbon" { -// CHECK:STDOUT: %.loc7_10: type = stub_reference i32 -// CHECK:STDOUT: %.loc7_15: type = stub_reference i32 // CHECK:STDOUT: %.loc7_18.1: type = tuple_type (type, type) -// CHECK:STDOUT: %.loc7_18.2: (type, type) = tuple_literal (%.loc7_10, %.loc7_15) -// CHECK:STDOUT: %.loc7_18.3: (type, type) = stub_reference %.loc7_18.2 -// CHECK:STDOUT: %.loc7_21: type = stub_reference i32 +// CHECK:STDOUT: %.loc7_18.2: (type, type) = tuple_literal (i32, i32) // CHECK:STDOUT: %.loc7_24.1: type = tuple_type ((type, type), type) -// CHECK:STDOUT: %.loc7_24.2: ((type, type), type) = tuple_literal (%.loc7_18.3, %.loc7_21) -// CHECK:STDOUT: %.loc7_18.4: type = tuple_type (i32, i32) +// CHECK:STDOUT: %.loc7_24.2: ((type, type), type) = tuple_literal (%.loc7_18.2, i32) +// CHECK:STDOUT: %.loc7_18.3: type = tuple_type (i32, i32) // CHECK:STDOUT: %.loc7_24.3: type = tuple_type ((i32, i32), i32) // CHECK:STDOUT: %x: ref ((i32, i32), i32) = var "x" -// CHECK:STDOUT: %.loc7_30.1: i32 = int_literal 12 -// CHECK:STDOUT: %.loc7_30.2: i32 = stub_reference %.loc7_30.1 -// CHECK:STDOUT: %.loc7_34.1: i32 = int_literal 76 -// CHECK:STDOUT: %.loc7_34.2: i32 = stub_reference %.loc7_34.1 -// CHECK:STDOUT: %.loc7_36.1: (i32, i32) = tuple_literal (%.loc7_30.2, %.loc7_34.2) -// CHECK:STDOUT: %.loc7_36.2: (i32, i32) = stub_reference %.loc7_36.1 -// CHECK:STDOUT: %.loc7_39.1: i32 = int_literal 6 -// CHECK:STDOUT: %.loc7_39.2: i32 = stub_reference %.loc7_39.1 -// CHECK:STDOUT: %.loc7_40: ((i32, i32), i32) = tuple_literal (%.loc7_36.2, %.loc7_39.2) +// CHECK:STDOUT: %.loc7_30: i32 = int_literal 12 +// CHECK:STDOUT: %.loc7_34: i32 = int_literal 76 +// CHECK:STDOUT: %.loc7_36: (i32, i32) = tuple_literal (%.loc7_30, %.loc7_34) +// CHECK:STDOUT: %.loc7_39: i32 = int_literal 6 +// CHECK:STDOUT: %.loc7_40: ((i32, i32), i32) = tuple_literal (%.loc7_36, %.loc7_39) // CHECK:STDOUT: %.loc7_41.1: i32 = int_literal 0 // CHECK:STDOUT: %.loc7_41.2: ref (i32, i32) = tuple_index %x, %.loc7_41.1 // CHECK:STDOUT: %.loc7_41.3: i32 = int_literal 0 // CHECK:STDOUT: %.loc7_41.4: ref i32 = tuple_index %.loc7_41.2, %.loc7_41.3 -// CHECK:STDOUT: %.loc7_41.5: init i32 = initialize_from %.loc7_30.2 to %.loc7_41.4 +// CHECK:STDOUT: %.loc7_41.5: init i32 = initialize_from %.loc7_30 to %.loc7_41.4 // CHECK:STDOUT: %.loc7_41.6: i32 = int_literal 1 // CHECK:STDOUT: %.loc7_41.7: ref i32 = tuple_index %.loc7_41.2, %.loc7_41.6 -// CHECK:STDOUT: %.loc7_41.8: init i32 = initialize_from %.loc7_34.2 to %.loc7_41.7 -// CHECK:STDOUT: %.loc7_41.9: init (i32, i32) = tuple_init %.loc7_36.1, (%.loc7_41.5, %.loc7_41.8) +// CHECK:STDOUT: %.loc7_41.8: init i32 = initialize_from %.loc7_34 to %.loc7_41.7 +// CHECK:STDOUT: %.loc7_41.9: init (i32, i32) = tuple_init %.loc7_36, (%.loc7_41.5, %.loc7_41.8) // CHECK:STDOUT: %.loc7_41.10: i32 = int_literal 1 // CHECK:STDOUT: %.loc7_41.11: ref i32 = tuple_index %x, %.loc7_41.10 -// CHECK:STDOUT: %.loc7_41.12: init i32 = initialize_from %.loc7_39.2 to %.loc7_41.11 +// CHECK:STDOUT: %.loc7_41.12: init i32 = initialize_from %.loc7_39 to %.loc7_41.11 // CHECK:STDOUT: %.loc7_41.13: init ((i32, i32), i32) = tuple_init %.loc7_40, (%.loc7_41.9, %.loc7_41.12) // CHECK:STDOUT: assign %x, %.loc7_41.13 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/tuples/one_element.carbon b/toolchain/check/testdata/tuples/one_element.carbon index 30605ed73f15..d60408fcc33f 100644 --- a/toolchain/check/testdata/tuples/one_element.carbon +++ b/toolchain/check/testdata/tuples/one_element.carbon @@ -8,20 +8,17 @@ var x: (i32,) = (4,); var y: (i32,) = x; // CHECK:STDOUT: file "one_element.carbon" { -// CHECK:STDOUT: %.loc7_9: type = stub_reference i32 // CHECK:STDOUT: %.loc7_13.1: type = tuple_type (type) -// CHECK:STDOUT: %.loc7_13.2: (type,) = tuple_literal (%.loc7_9) +// CHECK:STDOUT: %.loc7_13.2: (type,) = tuple_literal (i32) // CHECK:STDOUT: %.loc7_13.3: type = tuple_type (i32) // CHECK:STDOUT: %x: ref (i32,) = var "x" -// CHECK:STDOUT: %.loc7_18.1: i32 = int_literal 4 -// CHECK:STDOUT: %.loc7_18.2: i32 = stub_reference %.loc7_18.1 -// CHECK:STDOUT: %.loc7_20: (i32,) = tuple_literal (%.loc7_18.2) +// CHECK:STDOUT: %.loc7_18: i32 = int_literal 4 +// CHECK:STDOUT: %.loc7_20: (i32,) = tuple_literal (%.loc7_18) // CHECK:STDOUT: %.loc7_21.1: i32 = int_literal 0 // CHECK:STDOUT: %.loc7_21.2: ref i32 = tuple_index %x, %.loc7_21.1 -// CHECK:STDOUT: %.loc7_21.3: init (i32,) = tuple_init %.loc7_20, (%.loc7_18.2) +// CHECK:STDOUT: %.loc7_21.3: init (i32,) = tuple_init %.loc7_20, (%.loc7_18) // CHECK:STDOUT: assign %x, %.loc7_21.3 -// CHECK:STDOUT: %.loc8_9: type = stub_reference i32 -// CHECK:STDOUT: %.loc8_13: (type,) = tuple_literal (%.loc8_9) +// CHECK:STDOUT: %.loc8: (type,) = tuple_literal (i32) // CHECK:STDOUT: %y: ref (i32,) = var "y" // CHECK:STDOUT: %.loc7_5: (i32,) = bind_value %x // CHECK:STDOUT: assign %y, %.loc7_5 diff --git a/toolchain/check/testdata/tuples/two_elements.carbon b/toolchain/check/testdata/tuples/two_elements.carbon index 92c2c3e4d778..3cb212d49280 100644 --- a/toolchain/check/testdata/tuples/two_elements.carbon +++ b/toolchain/check/testdata/tuples/two_elements.carbon @@ -8,28 +8,22 @@ var x: (i32, i32) = (4, 102); var y: (i32, i32) = x; // CHECK:STDOUT: file "two_elements.carbon" { -// CHECK:STDOUT: %.loc7_9: type = stub_reference i32 -// CHECK:STDOUT: %.loc7_14: type = stub_reference i32 // CHECK:STDOUT: %.loc7_17.1: type = tuple_type (type, type) -// CHECK:STDOUT: %.loc7_17.2: (type, type) = tuple_literal (%.loc7_9, %.loc7_14) +// CHECK:STDOUT: %.loc7_17.2: (type, type) = tuple_literal (i32, i32) // CHECK:STDOUT: %.loc7_17.3: type = tuple_type (i32, i32) // CHECK:STDOUT: %x: ref (i32, i32) = var "x" -// CHECK:STDOUT: %.loc7_22.1: i32 = int_literal 4 -// CHECK:STDOUT: %.loc7_22.2: i32 = stub_reference %.loc7_22.1 -// CHECK:STDOUT: %.loc7_25.1: i32 = int_literal 102 -// CHECK:STDOUT: %.loc7_25.2: i32 = stub_reference %.loc7_25.1 -// CHECK:STDOUT: %.loc7_28: (i32, i32) = tuple_literal (%.loc7_22.2, %.loc7_25.2) +// CHECK:STDOUT: %.loc7_22: i32 = int_literal 4 +// CHECK:STDOUT: %.loc7_25: i32 = int_literal 102 +// CHECK:STDOUT: %.loc7_28: (i32, i32) = tuple_literal (%.loc7_22, %.loc7_25) // CHECK:STDOUT: %.loc7_29.1: i32 = int_literal 0 // CHECK:STDOUT: %.loc7_29.2: ref i32 = tuple_index %x, %.loc7_29.1 -// CHECK:STDOUT: %.loc7_29.3: init i32 = initialize_from %.loc7_22.2 to %.loc7_29.2 +// CHECK:STDOUT: %.loc7_29.3: init i32 = initialize_from %.loc7_22 to %.loc7_29.2 // CHECK:STDOUT: %.loc7_29.4: i32 = int_literal 1 // CHECK:STDOUT: %.loc7_29.5: ref i32 = tuple_index %x, %.loc7_29.4 -// CHECK:STDOUT: %.loc7_29.6: init i32 = initialize_from %.loc7_25.2 to %.loc7_29.5 +// CHECK:STDOUT: %.loc7_29.6: init i32 = initialize_from %.loc7_25 to %.loc7_29.5 // CHECK:STDOUT: %.loc7_29.7: init (i32, i32) = tuple_init %.loc7_28, (%.loc7_29.3, %.loc7_29.6) // CHECK:STDOUT: assign %x, %.loc7_29.7 -// CHECK:STDOUT: %.loc8_9: type = stub_reference i32 -// CHECK:STDOUT: %.loc8_14: type = stub_reference i32 -// CHECK:STDOUT: %.loc8_17: (type, type) = tuple_literal (%.loc8_9, %.loc8_14) +// CHECK:STDOUT: %.loc8: (type, type) = tuple_literal (i32, i32) // CHECK:STDOUT: %y: ref (i32, i32) = var "y" // CHECK:STDOUT: %.loc7_5: (i32, i32) = bind_value %x // CHECK:STDOUT: assign %y, %.loc7_5