From 396756c15150c2efb8a976b1b8380b480eb7aa85 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Tue, 31 Mar 2026 11:50:54 -0400 Subject: [PATCH] Handle Temporary values when const-evaling AcquireValue (#6992) This will be used for const-evaling functions. Splitting into a separate commit since it touches a lot of test files, and a couple fail_todo tests are no longer failing. --- toolchain/check/eval_inst.cpp | 17 ++- toolchain/check/testdata/alias/basics.carbon | 2 +- toolchain/check/testdata/array/import.carbon | 55 ++++--- .../testdata/array/index_not_literal.carbon | 2 +- .../testdata/as/adapter_conversion.carbon | 2 +- toolchain/check/testdata/as/basics.carbon | 2 +- toolchain/check/testdata/choice/basic.carbon | 10 +- .../check/testdata/choice/generic.carbon | 2 +- .../testdata/class/adapter/init_adapt.carbon | 4 +- .../class/generic/method_deduce.carbon | 2 +- .../testdata/class/generic/stringify.carbon | 141 ++++++++++-------- .../check/testdata/class/method/method.carbon | 2 +- .../check/testdata/deduce/generic_type.carbon | 2 +- .../value_with_type_through_access.carbon | 125 +++++++++------- toolchain/check/testdata/eval/binding.carbon | 2 +- toolchain/check/testdata/eval/call.carbon | 24 ++- .../facet/call_combined_impl_witness.carbon | 2 +- ...t_class_type_to_generic_facet_value.carbon | 2 +- ...rt_class_value_to_facet_value_value.carbon | 2 +- ..._value_to_generic_facet_value_value.carbon | 6 +- ...t_value_as_type_knows_original_type.carbon | 2 +- ..._value_to_generic_facet_value_value.carbon | 4 +- ...convert_facet_value_value_to_itself.carbon | 2 +- toolchain/check/testdata/for/basic.carbon | 11 +- .../testdata/function/generic/deduce.carbon | 2 +- .../testdata/impl/fail_impl_as_scope.carbon | 2 +- .../check/testdata/impl/import_thunk.carbon | 4 +- .../impl/lookup/canonical_query_self.carbon | 4 +- .../testdata/impl/use_assoc_entity.carbon | 2 +- .../testdata/interface/generic_method.carbon | 4 +- .../interop/cpp/function/default_arg.carbon | 4 +- .../interop/cpp/function/overloads.carbon | 8 +- .../interop/cpp/function/pointer.carbon | 2 +- .../interop/cpp/function/reference.carbon | 4 +- .../cpp/stdlib/initializer_list.carbon | 6 +- .../cpp/template/class_template.carbon | 2 +- .../operators/overloaded/index.carbon | 2 +- .../overloaded/index_with_prelude.carbon | 8 +- .../testdata/packages/missing_prelude.carbon | 2 +- .../return/import_convert_function.carbon | 16 +- .../testdata/array/function_param.carbon | 3 +- toolchain/lower/testdata/array/iterate.carbon | 5 +- toolchain/lower/testdata/builtins/cpp.carbon | 7 +- .../function/definition/destroy.carbon | 3 +- .../function/definition/var_param.carbon | 3 +- .../testdata/interop/cpp/reference.carbon | 6 +- .../interop/cpp/std_initializer_list.carbon | 14 +- .../testdata/interop/cpp/template.carbon | 7 +- 48 files changed, 304 insertions(+), 241 deletions(-) diff --git a/toolchain/check/eval_inst.cpp b/toolchain/check/eval_inst.cpp index b1abc69ee967..27c489cca70d 100644 --- a/toolchain/check/eval_inst.cpp +++ b/toolchain/check/eval_inst.cpp @@ -127,17 +127,20 @@ auto EvalConstantInst(Context& /*context*/, SemIR::ValueBinding /*inst*/) auto EvalConstantInst(Context& context, SemIR::InstId inst_id, SemIR::AcquireValue inst) -> ConstantEvalResult { + SemIR::ConstantId const_id = SemIR::ConstantId::NotConstant; if (const auto* var_decl = GetAsClangVarDecl(context, inst.value_id)) { - auto const_id = + const_id = EvalCppVarDecl(context, SemIR::LocId(inst_id), var_decl, inst.type_id); - if (const_id.has_value() && const_id.is_constant()) { - return ConstantEvalResult::Existing(const_id); - } - - return ConstantEvalResult::NotConstant; + } else if (auto temporary = + context.insts().TryGetAs(inst.value_id)) { + const_id = context.constant_values().Get(temporary->init_id); } - return ConstantEvalResult::TODO; + if (const_id.has_value() && const_id.is_constant()) { + return ConstantEvalResult::Existing(const_id); + } + + return ConstantEvalResult::NotConstant; } auto EvalConstantInst(Context& context, SemIR::ClassElementAccess inst) diff --git a/toolchain/check/testdata/alias/basics.carbon b/toolchain/check/testdata/alias/basics.carbon index 750750c5e645..fb12584e0478 100644 --- a/toolchain/check/testdata/alias/basics.carbon +++ b/toolchain/check/testdata/alias/basics.carbon @@ -189,7 +189,7 @@ extern alias C = Class; // CHECK:STDOUT: %.loc10_13.2: init %C to %.loc10_13.1 = class_init () [concrete = constants.%C.val] // CHECK:STDOUT: %.loc10_13.3: init %C = converted @__global_init.%.loc10, %.loc10_13.2 [concrete = constants.%C.val] // CHECK:STDOUT: %.loc10_13.4: ref %C = temporary %.loc10_13.1, %.loc10_13.3 [concrete = constants.%.5ea] -// CHECK:STDOUT: %.loc10_13.5: %C = acquire_value %.loc10_13.4 +// CHECK:STDOUT: %.loc10_13.5: %C = acquire_value %.loc10_13.4 [concrete = constants.%C.val] // CHECK:STDOUT: %d: %C = value_binding d, %.loc10_13.5 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/array/import.carbon b/toolchain/check/testdata/array/import.carbon index 6a174b0a1545..aad5df0e7ea2 100644 --- a/toolchain/check/testdata/array/import.carbon +++ b/toolchain/check/testdata/array/import.carbon @@ -26,7 +26,7 @@ fn G(n: i32) -> i32 { //@dump-sem-ir-end } -// --- fail_todo_symbolic_decl.carbon +// --- symbolic_decl.carbon library "[[@TEST_NAME]]"; @@ -36,25 +36,18 @@ interface I { class C {} -// CHECK:STDERR: fail_todo_symbolic_decl.carbon:[[@LINE+4]]:28: error: expression is runtime; expected constant [EvalRequiresConstantValue] -// CHECK:STDERR: impl C as I where .value = (1,) {} -// CHECK:STDERR: ^~~~ -// CHECK:STDERR: impl C as I where .value = (1,) {} -// --- fail_todo_import_symbolic_decl.carbon +// --- import_symbolic_decl.carbon library "[[@TEST_NAME]]"; import library "symbolic_decl"; -fn F() -> array(i32, 1) { +fn F() -> i32 { //@dump-sem-ir-begin - // CHECK:STDERR: fail_todo_import_symbolic_decl.carbon:[[@LINE+4]]:11: error: cannot convert type `C` into type implementing `I` [ConversionFailureTypeToFacet] - // CHECK:STDERR: return (C as I).value; - // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: - return (C as I).value; + let a: array(i32, 1) = (C as I).value; //@dump-sem-ir-end + return a[0]; } // CHECK:STDOUT: --- user.carbon @@ -109,27 +102,53 @@ fn F() -> array(i32, 1) { // CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %array_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: --- fail_todo_import_symbolic_decl.carbon +// CHECK:STDOUT: --- import_symbolic_decl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete] -// CHECK:STDOUT: %array_type: type = array_type %int_1, %i32 [concrete] +// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] +// CHECK:STDOUT: %array_type: type = array_type %int_1.5b8, %i32 [concrete] +// CHECK:STDOUT: %pattern_type.a98: type = pattern_type %array_type [concrete] // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete] +// CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] +// CHECK:STDOUT: %array: %array_type = tuple_value (%int_1.5d2) [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness imports.%I.impl_witness_table [concrete] +// CHECK:STDOUT: %I.facet: %I.type = facet_value %C, (%I.impl_witness) [concrete] +// CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete] +// CHECK:STDOUT: %assoc0.5b3: %I.assoc_type = assoc_entity element0, imports.%Main.import_ref.ae1 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Main.I: type = import_ref Main//symbolic_decl, I, loaded [concrete = constants.%I.type] // CHECK:STDOUT: %Main.C: type = import_ref Main//symbolic_decl, C, loaded [concrete = constants.%C] +// CHECK:STDOUT: %Main.import_ref.353: %I.assoc_type = import_ref Main//symbolic_decl, loc5_12, loaded [concrete = constants.%assoc0.5b3] +// CHECK:STDOUT: %Main.import_ref.e29: %array_type = import_ref Main//symbolic_decl, loc10_33, loaded [concrete = constants.%array] +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%Main.import_ref.e29), @C.as.I.impl [concrete] +// CHECK:STDOUT: %Main.import_ref.ae1: %array_type = import_ref Main//symbolic_decl, loc5_12, loaded [concrete = %value] +// CHECK:STDOUT: %value: %array_type = assoc_const_decl @value [concrete] {} // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F() -> out %return.param: %array_type { +// CHECK:STDOUT: fn @F() -> out %return.param: %i32 { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %a.patt: %pattern_type.a98 = value_binding_pattern a [concrete] +// CHECK:STDOUT: } // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%Main.C [concrete = constants.%C] // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%Main.I [concrete = constants.%I.type] -// CHECK:STDOUT: %value.ref: = name_ref value, [concrete = ] -// CHECK:STDOUT: return to %return.param +// CHECK:STDOUT: %I.facet: %I.type = facet_value %C.ref, (constants.%I.impl_witness) [concrete = constants.%I.facet] +// CHECK:STDOUT: %.loc7_29: %I.type = converted %C.ref, %I.facet [concrete = constants.%I.facet] +// CHECK:STDOUT: %as_type: type = facet_access_type %.loc7_29 [concrete = constants.%C] +// CHECK:STDOUT: %.loc7_34: type = converted %.loc7_29, %as_type [concrete = constants.%C] +// CHECK:STDOUT: %value.ref: %I.assoc_type = name_ref value, imports.%Main.import_ref.353 [concrete = constants.%assoc0.5b3] +// CHECK:STDOUT: %impl.elem0.loc7: %array_type = impl_witness_access constants.%I.impl_witness, element0 [concrete = constants.%array] +// CHECK:STDOUT: %.loc7_22: type = splice_block %array_type [concrete = constants.%array_type] { +// CHECK:STDOUT: %i32.loc7: type = type_literal constants.%i32 [concrete = constants.%i32] +// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] +// CHECK:STDOUT: %array_type: type = array_type %int_1, %i32.loc7 [concrete = constants.%array_type] +// CHECK:STDOUT: } +// CHECK:STDOUT: %a: %array_type = value_binding a, %impl.elem0.loc7 +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/array/index_not_literal.carbon b/toolchain/check/testdata/array/index_not_literal.carbon index 5832ea81619a..827951aabcee 100644 --- a/toolchain/check/testdata/array/index_not_literal.carbon +++ b/toolchain/check/testdata/array/index_not_literal.carbon @@ -156,7 +156,7 @@ fn F(a: array({}, 3)) -> {} { // CHECK:STDOUT: %.loc10_20.12: init %array_type to %.loc10_20.3 = array_init (%.loc10_20.5, %.loc10_20.8, %.loc10_20.11) [concrete = constants.%array] // CHECK:STDOUT: %.loc10_20.13: init %array_type = converted %.loc10_20.1, %.loc10_20.12 [concrete = constants.%array] // CHECK:STDOUT: %.loc10_20.14: ref %array_type = temporary %.loc10_20.3, %.loc10_20.13 [concrete = constants.%.fd3] -// CHECK:STDOUT: %.loc10_20.15: %array_type = acquire_value %.loc10_20.14 +// CHECK:STDOUT: %.loc10_20.15: %array_type = acquire_value %.loc10_20.14 [concrete = constants.%array] // CHECK:STDOUT: %impl.elem0.loc10_23: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] // CHECK:STDOUT: %bound_method.loc10_23.1: = bound_method %int_1.loc10_23, %impl.elem0.loc10_23 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215] // CHECK:STDOUT: %specific_fn.loc10_23: = specific_function %impl.elem0.loc10_23, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] diff --git a/toolchain/check/testdata/as/adapter_conversion.carbon b/toolchain/check/testdata/as/adapter_conversion.carbon index 3363349941ff..09414b1b0b58 100644 --- a/toolchain/check/testdata/as/adapter_conversion.carbon +++ b/toolchain/check/testdata/as/adapter_conversion.carbon @@ -368,7 +368,7 @@ var b: B = {.x = ()} as B; // CHECK:STDOUT: } // CHECK:STDOUT: %B.ref: type = name_ref B, %B.decl [concrete = constants.%B] // CHECK:STDOUT: %.loc14_42.1: ref %B = temporary @__global_init.%.loc14_34.3, @__global_init.%.loc14_42.2 [concrete = constants.%.4e1] -// CHECK:STDOUT: %.loc14_42.2: %B = acquire_value %.loc14_42.1 +// CHECK:STDOUT: %.loc14_42.2: %B = acquire_value %.loc14_42.1 [concrete = constants.%B.val] // CHECK:STDOUT: %b_value: %B = value_binding b_value, %.loc14_42.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/as/basics.carbon b/toolchain/check/testdata/as/basics.carbon index 016ede8a245b..75a1c2a3da35 100644 --- a/toolchain/check/testdata/as/basics.carbon +++ b/toolchain/check/testdata/as/basics.carbon @@ -400,7 +400,7 @@ let n: {.x: ()} = {.x = ()} as {.x = ()}; // CHECK:STDOUT: %bound_method: = bound_method %.loc19_23.1, %impl.elem0 [concrete = constants.%X.as.As.impl.Convert.bound] // CHECK:STDOUT: %.loc19_29.1: ref %Y = temporary_storage // CHECK:STDOUT: %.loc19_23.2: ref %X = temporary %.loc19_21.2, %.loc19_23.1 [concrete = constants.%.730] -// CHECK:STDOUT: %.loc19_23.3: %X = acquire_value %.loc19_23.2 +// CHECK:STDOUT: %.loc19_23.3: %X = acquire_value %.loc19_23.2 [concrete = constants.%X.val] // CHECK:STDOUT: %X.as.As.impl.Convert.call: init %Y to %.loc19_29.1 = call %bound_method(%.loc19_23.3) // CHECK:STDOUT: %.loc19_29.2: init %Y = converted %.loc19_23.1, %X.as.As.impl.Convert.call // CHECK:STDOUT: diff --git a/toolchain/check/testdata/choice/basic.carbon b/toolchain/check/testdata/choice/basic.carbon index 4590e302ae68..aa0ca647752c 100644 --- a/toolchain/check/testdata/choice/basic.carbon +++ b/toolchain/check/testdata/choice/basic.carbon @@ -114,7 +114,7 @@ let never: Never = {}; // CHECK:STDOUT: %.loc6_1.8: init %Always to %.loc6_1.4 = class_init (%.loc6_1.7) [concrete = constants.%Always.val] // CHECK:STDOUT: %.loc6_1.9: init %Always = converted %.loc6_1.3, %.loc6_1.8 [concrete = constants.%Always.val] // CHECK:STDOUT: %.loc6_1.10: ref %Always = temporary %.loc6_1.4, %.loc6_1.9 [concrete = constants.%.bc0] -// CHECK:STDOUT: %.loc6_1.11: %Always = acquire_value %.loc6_1.10 +// CHECK:STDOUT: %.loc6_1.11: %Always = acquire_value %.loc6_1.10 [concrete = constants.%Always.val] // CHECK:STDOUT: %Sunny: %Always = value_binding Sunny, %.loc6_1.11 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: @@ -251,7 +251,7 @@ let never: Never = {}; // CHECK:STDOUT: %.loc5_7.7: init %Ordering to %.loc5_7.4 = class_init (%.loc5_7.6) [concrete = constants.%Ordering.val.9ea] // CHECK:STDOUT: %.loc5_7.8: init %Ordering = converted %.loc5_7.3, %.loc5_7.7 [concrete = constants.%Ordering.val.9ea] // CHECK:STDOUT: %.loc5_7.9: ref %Ordering = temporary %.loc5_7.4, %.loc5_7.8 [concrete = constants.%.917] -// CHECK:STDOUT: %.loc5_7.10: %Ordering = acquire_value %.loc5_7.9 +// CHECK:STDOUT: %.loc5_7.10: %Ordering = acquire_value %.loc5_7.9 [concrete = constants.%Ordering.val.9ea] // CHECK:STDOUT: %Less: %Ordering = value_binding Less, %.loc5_7.10 // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %impl.elem0.loc6_13.1: %.055 = impl_witness_access constants.%ImplicitAs.impl_witness.762, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0ed] @@ -273,7 +273,7 @@ let never: Never = {}; // CHECK:STDOUT: %.loc6_13.7: init %Ordering to %.loc6_13.4 = class_init (%.loc6_13.6) [concrete = constants.%Ordering.val.d41] // CHECK:STDOUT: %.loc6_13.8: init %Ordering = converted %.loc6_13.3, %.loc6_13.7 [concrete = constants.%Ordering.val.d41] // CHECK:STDOUT: %.loc6_13.9: ref %Ordering = temporary %.loc6_13.4, %.loc6_13.8 [concrete = constants.%.1a9] -// CHECK:STDOUT: %.loc6_13.10: %Ordering = acquire_value %.loc6_13.9 +// CHECK:STDOUT: %.loc6_13.10: %Ordering = acquire_value %.loc6_13.9 [concrete = constants.%Ordering.val.d41] // CHECK:STDOUT: %Equivalent: %Ordering = value_binding Equivalent, %.loc6_13.10 // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %impl.elem0.loc7_10.1: %.055 = impl_witness_access constants.%ImplicitAs.impl_witness.762, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0ed] @@ -295,7 +295,7 @@ let never: Never = {}; // CHECK:STDOUT: %.loc7_10.7: init %Ordering to %.loc7_10.4 = class_init (%.loc7_10.6) [concrete = constants.%Ordering.val.e86] // CHECK:STDOUT: %.loc7_10.8: init %Ordering = converted %.loc7_10.3, %.loc7_10.7 [concrete = constants.%Ordering.val.e86] // CHECK:STDOUT: %.loc7_10.9: ref %Ordering = temporary %.loc7_10.4, %.loc7_10.8 [concrete = constants.%.c4a] -// CHECK:STDOUT: %.loc7_10.10: %Ordering = acquire_value %.loc7_10.9 +// CHECK:STDOUT: %.loc7_10.10: %Ordering = acquire_value %.loc7_10.9 [concrete = constants.%Ordering.val.e86] // CHECK:STDOUT: %Greater: %Ordering = value_binding Greater, %.loc7_10.10 // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba] // CHECK:STDOUT: %impl.elem0.loc9_1.1: %.055 = impl_witness_access constants.%ImplicitAs.impl_witness.762, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0ed] @@ -317,7 +317,7 @@ let never: Never = {}; // CHECK:STDOUT: %.loc9_1.7: init %Ordering to %.loc9_1.4 = class_init (%.loc9_1.6) [concrete = constants.%Ordering.val.a17] // CHECK:STDOUT: %.loc9_1.8: init %Ordering = converted %.loc9_1.3, %.loc9_1.7 [concrete = constants.%Ordering.val.a17] // CHECK:STDOUT: %.loc9_1.9: ref %Ordering = temporary %.loc9_1.4, %.loc9_1.8 [concrete = constants.%.ab9] -// CHECK:STDOUT: %.loc9_1.10: %Ordering = acquire_value %.loc9_1.9 +// CHECK:STDOUT: %.loc9_1.10: %Ordering = acquire_value %.loc9_1.9 [concrete = constants.%Ordering.val.a17] // CHECK:STDOUT: %Incomparable: %Ordering = value_binding Incomparable, %.loc9_1.10 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: diff --git a/toolchain/check/testdata/choice/generic.carbon b/toolchain/check/testdata/choice/generic.carbon index 1912c8862d36..4fe2a3abd7d0 100644 --- a/toolchain/check/testdata/choice/generic.carbon +++ b/toolchain/check/testdata/choice/generic.carbon @@ -68,7 +68,7 @@ choice Always(T:! type) { // CHECK:STDOUT: %.loc16_1.8: init @Always.%Always (%Always) to %.loc16_1.4 = class_init (%.loc16_1.7) [symbolic = %Always.val (constants.%Always.val)] // CHECK:STDOUT: %.loc16_1.9: init @Always.%Always (%Always) = converted %.loc16_1.3, %.loc16_1.8 [symbolic = %Always.val (constants.%Always.val)] // CHECK:STDOUT: %.loc16_1.10: ref @Always.%Always (%Always) = temporary %.loc16_1.4, %.loc16_1.9 [symbolic = %.loc16_1.12 (constants.%.19a)] -// CHECK:STDOUT: %.loc16_1.11: @Always.%Always (%Always) = acquire_value %.loc16_1.10 +// CHECK:STDOUT: %.loc16_1.11: @Always.%Always (%Always) = acquire_value %.loc16_1.10 [symbolic = %Always.val (constants.%Always.val)] // CHECK:STDOUT: %Sunny: @Always.%Always (%Always) = value_binding Sunny, %.loc16_1.11 // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/adapter/init_adapt.carbon b/toolchain/check/testdata/class/adapter/init_adapt.carbon index fd73dd9bdfb8..39939f1655fe 100644 --- a/toolchain/check/testdata/class/adapter/init_adapt.carbon +++ b/toolchain/check/testdata/class/adapter/init_adapt.carbon @@ -196,7 +196,7 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %.loc13_27.8: init %C to %.loc13_27.2 = class_init (%.loc13_27.4, %.loc13_27.7) [concrete = constants.%C.val] // CHECK:STDOUT: %.loc13_27.9: init %C = converted @__global_init.%.loc13, %.loc13_27.8 [concrete = constants.%C.val] // CHECK:STDOUT: %.loc13_27.10: ref %C = temporary %.loc13_27.2, %.loc13_27.9 [concrete = constants.%.740] -// CHECK:STDOUT: %.loc13_27.11: %C = acquire_value %.loc13_27.10 +// CHECK:STDOUT: %.loc13_27.11: %C = acquire_value %.loc13_27.10 [concrete = constants.%C.val] // CHECK:STDOUT: %a: %C = value_binding a, %.loc13_27.11 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %b.patt: %pattern_type.507 = value_binding_pattern b [concrete] @@ -401,7 +401,7 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %.loc13_27.8: init %C to %.loc13_27.2 = class_init (%.loc13_27.4, %.loc13_27.7) [concrete = constants.%C.val] // CHECK:STDOUT: %.loc13_27.9: init %C = converted @__global_init.%.loc13, %.loc13_27.8 [concrete = constants.%C.val] // CHECK:STDOUT: %.loc13_27.10: ref %C = temporary %.loc13_27.2, %.loc13_27.9 [concrete = constants.%.740] -// CHECK:STDOUT: %.loc13_27.11: %C = acquire_value %.loc13_27.10 +// CHECK:STDOUT: %.loc13_27.11: %C = acquire_value %.loc13_27.10 [concrete = constants.%C.val] // CHECK:STDOUT: %a: %C = value_binding a, %.loc13_27.11 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %b.patt: %pattern_type.507 = value_binding_pattern b [concrete] diff --git a/toolchain/check/testdata/class/generic/method_deduce.carbon b/toolchain/check/testdata/class/generic/method_deduce.carbon index 420135b3aa79..8eda27a512b5 100644 --- a/toolchain/check/testdata/class/generic/method_deduce.carbon +++ b/toolchain/check/testdata/class/generic/method_deduce.carbon @@ -312,7 +312,7 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: %.loc28_25.3: init %A to %.loc28_25.2 = class_init () [concrete = constants.%A.val] // CHECK:STDOUT: %.loc28_25.4: init %A = converted %.loc28_25.1, %.loc28_25.3 [concrete = constants.%A.val] // CHECK:STDOUT: %.loc28_25.5: ref %A = temporary %.loc28_25.2, %.loc28_25.4 [concrete = constants.%.33f] -// CHECK:STDOUT: %.loc28_25.6: %A = acquire_value %.loc28_25.5 +// CHECK:STDOUT: %.loc28_25.6: %A = acquire_value %.loc28_25.5 [concrete = constants.%A.val] // CHECK:STDOUT: %Class.GetNoDeduce.call: init %tuple.type.e87 to %.loc27_62.1 = call %Class.GetNoDeduce.specific_fn(%.loc28_25.6) // CHECK:STDOUT: return %Class.GetNoDeduce.call to %return.param // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/generic/stringify.carbon b/toolchain/check/testdata/class/generic/stringify.carbon index 183262ad64d5..8a94d3e825f3 100644 --- a/toolchain/check/testdata/class/generic/stringify.carbon +++ b/toolchain/check/testdata/class/generic/stringify.carbon @@ -76,19 +76,12 @@ class D { class E(F:! D) {} -// CHECK:STDERR: fail_class_param.carbon:[[@LINE+14]]:8: error: argument for generic parameter is not a compile-time constant [CompTimeArgumentNotConstant] +// CHECK:STDERR: fail_class_param.carbon:[[@LINE+7]]:1: error: cannot implicitly convert expression of type `E({.a = 3, .b = 4})` to `E({.a = 1, .b = 2})` [ConversionFailure] // CHECK:STDERR: var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_class_param.carbon:[[@LINE-5]]:9: note: initializing generic parameter `F` declared here [InitializingGenericParam] -// CHECK:STDERR: class E(F:! D) {} -// CHECK:STDERR: ^~~~~ -// CHECK:STDERR: -// CHECK:STDERR: fail_class_param.carbon:[[@LINE+7]]:36: error: argument for generic parameter is not a compile-time constant [CompTimeArgumentNotConstant] +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_class_param.carbon:[[@LINE+4]]:1: note: type `E({.a = 3, .b = 4})` does not implement interface `Core.ImplicitAs(E({.a = 1, .b = 2}))` [MissingImplInMemberAccessInContext] // CHECK:STDERR: var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_class_param.carbon:[[@LINE-12]]:9: note: initializing generic parameter `F` declared here [InitializingGenericParam] -// CHECK:STDERR: class E(F:! D) {} -// CHECK:STDERR: ^~~~~ +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); @@ -514,7 +507,7 @@ var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDOUT: %F: %D = symbolic_binding F, 0 [symbolic] // CHECK:STDOUT: %E.type: type = generic_class_type @E [concrete] // CHECK:STDOUT: %E.generic: %E.type = struct_value () [concrete] -// CHECK:STDOUT: %E: type = class_type @E, @E(%F) [symbolic] +// CHECK:STDOUT: %E.bcb: type = class_type @E, @E(%F) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] @@ -542,6 +535,8 @@ var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %D.val.525: %D = struct_value (%int_1.5d2, %int_2.ef8) [concrete] // CHECK:STDOUT: %.88a: ref %D = temporary invalid, %D.val.525 [concrete] +// CHECK:STDOUT: %E.254: type = class_type @E, @E(%D.val.525) [concrete] +// CHECK:STDOUT: %pattern_type.663: type = pattern_type %E.254 [concrete] // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete] // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete] // CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [concrete] @@ -554,6 +549,8 @@ var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDOUT: %int_4.940: %i32 = int_value 4 [concrete] // CHECK:STDOUT: %D.val.659: %D = struct_value (%int_3.822, %int_4.940) [concrete] // CHECK:STDOUT: %.aec: ref %D = temporary invalid, %D.val.659 [concrete] +// CHECK:STDOUT: %E.1a1: type = class_type @E, @E(%D.val.659) [concrete] +// CHECK:STDOUT: %E.val: %E.1a1 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -588,38 +585,39 @@ var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDOUT: %F.loc9_10.2: %D = symbolic_binding F, 0 [symbolic = %F.loc9_10.1 (constants.%F)] // CHECK:STDOUT: } // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %g.patt: = ref_binding_pattern g [concrete] -// CHECK:STDOUT: %g.var_patt: = var_pattern %g.patt [concrete] +// CHECK:STDOUT: %g.patt: %pattern_type.663 = ref_binding_pattern g [concrete] +// CHECK:STDOUT: %g.var_patt: %pattern_type.663 = var_pattern %g.patt [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %g.var: ref = var %g.var_patt [concrete = ] -// CHECK:STDOUT: %.1: = splice_block [concrete = ] { +// CHECK:STDOUT: %g.var: ref %E.254 = var %g.var_patt [concrete] +// CHECK:STDOUT: %.loc18_26.1: type = splice_block %E [concrete = constants.%E.254] { // CHECK:STDOUT: %E.ref: %E.type = name_ref E, %E.decl [concrete = constants.%E.generic] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] -// CHECK:STDOUT: %.loc25_25.1: %struct_type.a.b.cfd = struct_literal (%int_1, %int_2) [concrete = constants.%struct.4aa] -// CHECK:STDOUT: %impl.elem0.loc25_25.1: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc25_25.1: = bound_method %int_1, %impl.elem0.loc25_25.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215] -// CHECK:STDOUT: %specific_fn.loc25_25.1: = specific_function %impl.elem0.loc25_25.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc25_25.2: = bound_method %int_1, %specific_fn.loc25_25.1 [concrete = constants.%bound_method.38b] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc25_25.1: init %i32 = call %bound_method.loc25_25.2(%int_1) [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc25_25.2: init %i32 = converted %int_1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc25_25.1 [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc25_25.3: ref %D = temporary_storage -// CHECK:STDOUT: %.loc25_25.4: ref %i32 = class_element_access %.loc25_25.3, element0 -// CHECK:STDOUT: %.loc25_25.5: init %i32 to %.loc25_25.4 = in_place_init %.loc25_25.2 [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %impl.elem0.loc25_25.2: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc25_25.3: = bound_method %int_2, %impl.elem0.loc25_25.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5] -// CHECK:STDOUT: %specific_fn.loc25_25.2: = specific_function %impl.elem0.loc25_25.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc25_25.4: = bound_method %int_2, %specific_fn.loc25_25.2 [concrete = constants.%bound_method.646] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc25_25.2: init %i32 = call %bound_method.loc25_25.4(%int_2) [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc25_25.6: init %i32 = converted %int_2, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc25_25.2 [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc25_25.7: ref %i32 = class_element_access %.loc25_25.3, element1 -// CHECK:STDOUT: %.loc25_25.8: init %i32 to %.loc25_25.7 = in_place_init %.loc25_25.6 [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc25_25.9: init %D to %.loc25_25.3 = class_init (%.loc25_25.5, %.loc25_25.8) [concrete = constants.%D.val.525] -// CHECK:STDOUT: %.loc25_26.1: init %D = converted %.loc25_25.1, %.loc25_25.9 [concrete = constants.%D.val.525] -// CHECK:STDOUT: %.loc25_26.2: ref %D = temporary %.loc25_25.3, %.loc25_26.1 [concrete = constants.%.88a] -// CHECK:STDOUT: %.loc25_26.3: %D = acquire_value %.loc25_26.2 +// CHECK:STDOUT: %.loc18_25.1: %struct_type.a.b.cfd = struct_literal (%int_1, %int_2) [concrete = constants.%struct.4aa] +// CHECK:STDOUT: %impl.elem0.loc18_25.1: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] +// CHECK:STDOUT: %bound_method.loc18_25.1: = bound_method %int_1, %impl.elem0.loc18_25.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215] +// CHECK:STDOUT: %specific_fn.loc18_25.1: = specific_function %impl.elem0.loc18_25.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc18_25.2: = bound_method %int_1, %specific_fn.loc18_25.1 [concrete = constants.%bound_method.38b] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc18_25.1: init %i32 = call %bound_method.loc18_25.2(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc18_25.2: init %i32 = converted %int_1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc18_25.1 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc18_25.3: ref %D = temporary_storage +// CHECK:STDOUT: %.loc18_25.4: ref %i32 = class_element_access %.loc18_25.3, element0 +// CHECK:STDOUT: %.loc18_25.5: init %i32 to %.loc18_25.4 = in_place_init %.loc18_25.2 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc18_25.2: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] +// CHECK:STDOUT: %bound_method.loc18_25.3: = bound_method %int_2, %impl.elem0.loc18_25.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5] +// CHECK:STDOUT: %specific_fn.loc18_25.2: = specific_function %impl.elem0.loc18_25.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc18_25.4: = bound_method %int_2, %specific_fn.loc18_25.2 [concrete = constants.%bound_method.646] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc18_25.2: init %i32 = call %bound_method.loc18_25.4(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc18_25.6: init %i32 = converted %int_2, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc18_25.2 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc18_25.7: ref %i32 = class_element_access %.loc18_25.3, element1 +// CHECK:STDOUT: %.loc18_25.8: init %i32 to %.loc18_25.7 = in_place_init %.loc18_25.6 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc18_25.9: init %D to %.loc18_25.3 = class_init (%.loc18_25.5, %.loc18_25.8) [concrete = constants.%D.val.525] +// CHECK:STDOUT: %.loc18_26.2: init %D = converted %.loc18_25.1, %.loc18_25.9 [concrete = constants.%D.val.525] +// CHECK:STDOUT: %.loc18_26.3: ref %D = temporary %.loc18_25.3, %.loc18_26.2 [concrete = constants.%.88a] +// CHECK:STDOUT: %.loc18_26.4: %D = acquire_value %.loc18_26.3 [concrete = constants.%D.val.525] +// CHECK:STDOUT: %E: type = class_type @E, @E(constants.%D.val.525) [concrete = constants.%E.254] // CHECK:STDOUT: } -// CHECK:STDOUT: %g: ref = ref_binding g, [concrete = ] +// CHECK:STDOUT: %g: ref %E.254 = ref_binding g, %g.var [concrete = %g.var] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @D { @@ -646,39 +644,44 @@ var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%E +// CHECK:STDOUT: .Self = constants.%E.bcb // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc25_31: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc18_31.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] // CHECK:STDOUT: %E.ref: %E.type = name_ref E, file.%E.decl [concrete = constants.%E.generic] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba] // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete = constants.%int_4.0c1] -// CHECK:STDOUT: %.loc25_53.1: %struct_type.a.b.cfd = struct_literal (%int_3, %int_4) [concrete = constants.%struct.cb7] +// CHECK:STDOUT: %.loc18_53.1: %struct_type.a.b.cfd = struct_literal (%int_3, %int_4) [concrete = constants.%struct.cb7] // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D] -// CHECK:STDOUT: %impl.elem0.loc25_53.1: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc25_53.1: = bound_method %int_3, %impl.elem0.loc25_53.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.061] -// CHECK:STDOUT: %specific_fn.loc25_53.1: = specific_function %impl.elem0.loc25_53.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc25_53.2: = bound_method %int_3, %specific_fn.loc25_53.1 [concrete = constants.%bound_method.fa7] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc25_53.1: init %i32 = call %bound_method.loc25_53.2(%int_3) [concrete = constants.%int_3.822] -// CHECK:STDOUT: %.loc25_53.2: init %i32 = converted %int_3, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc25_53.1 [concrete = constants.%int_3.822] -// CHECK:STDOUT: %.loc25_53.3: ref %D = temporary_storage -// CHECK:STDOUT: %.loc25_53.4: ref %i32 = class_element_access %.loc25_53.3, element0 -// CHECK:STDOUT: %.loc25_53.5: init %i32 to %.loc25_53.4 = in_place_init %.loc25_53.2 [concrete = constants.%int_3.822] -// CHECK:STDOUT: %impl.elem0.loc25_53.2: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] -// CHECK:STDOUT: %bound_method.loc25_53.3: = bound_method %int_4, %impl.elem0.loc25_53.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.f0c] -// CHECK:STDOUT: %specific_fn.loc25_53.2: = specific_function %impl.elem0.loc25_53.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc25_53.4: = bound_method %int_4, %specific_fn.loc25_53.2 [concrete = constants.%bound_method.6d7] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc25_53.2: init %i32 = call %bound_method.loc25_53.4(%int_4) [concrete = constants.%int_4.940] -// CHECK:STDOUT: %.loc25_53.6: init %i32 = converted %int_4, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc25_53.2 [concrete = constants.%int_4.940] -// CHECK:STDOUT: %.loc25_53.7: ref %i32 = class_element_access %.loc25_53.3, element1 -// CHECK:STDOUT: %.loc25_53.8: init %i32 to %.loc25_53.7 = in_place_init %.loc25_53.6 [concrete = constants.%int_4.940] -// CHECK:STDOUT: %.loc25_53.9: init %D to %.loc25_53.3 = class_init (%.loc25_53.5, %.loc25_53.8) [concrete = constants.%D.val.659] -// CHECK:STDOUT: %.loc25_55.1: init %D = converted %.loc25_53.1, %.loc25_53.9 [concrete = constants.%D.val.659] -// CHECK:STDOUT: %.loc25_55.2: ref %D = temporary %.loc25_53.3, %.loc25_55.1 [concrete = constants.%.aec] -// CHECK:STDOUT: %.loc25_55.3: %D = acquire_value %.loc25_55.2 +// CHECK:STDOUT: %impl.elem0.loc18_53.1: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] +// CHECK:STDOUT: %bound_method.loc18_53.1: = bound_method %int_3, %impl.elem0.loc18_53.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.061] +// CHECK:STDOUT: %specific_fn.loc18_53.1: = specific_function %impl.elem0.loc18_53.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc18_53.2: = bound_method %int_3, %specific_fn.loc18_53.1 [concrete = constants.%bound_method.fa7] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc18_53.1: init %i32 = call %bound_method.loc18_53.2(%int_3) [concrete = constants.%int_3.822] +// CHECK:STDOUT: %.loc18_53.2: init %i32 = converted %int_3, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc18_53.1 [concrete = constants.%int_3.822] +// CHECK:STDOUT: %.loc18_53.3: ref %D = temporary_storage +// CHECK:STDOUT: %.loc18_53.4: ref %i32 = class_element_access %.loc18_53.3, element0 +// CHECK:STDOUT: %.loc18_53.5: init %i32 to %.loc18_53.4 = in_place_init %.loc18_53.2 [concrete = constants.%int_3.822] +// CHECK:STDOUT: %impl.elem0.loc18_53.2: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] +// CHECK:STDOUT: %bound_method.loc18_53.3: = bound_method %int_4, %impl.elem0.loc18_53.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.f0c] +// CHECK:STDOUT: %specific_fn.loc18_53.2: = specific_function %impl.elem0.loc18_53.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc18_53.4: = bound_method %int_4, %specific_fn.loc18_53.2 [concrete = constants.%bound_method.6d7] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc18_53.2: init %i32 = call %bound_method.loc18_53.4(%int_4) [concrete = constants.%int_4.940] +// CHECK:STDOUT: %.loc18_53.6: init %i32 = converted %int_4, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc18_53.2 [concrete = constants.%int_4.940] +// CHECK:STDOUT: %.loc18_53.7: ref %i32 = class_element_access %.loc18_53.3, element1 +// CHECK:STDOUT: %.loc18_53.8: init %i32 to %.loc18_53.7 = in_place_init %.loc18_53.6 [concrete = constants.%int_4.940] +// CHECK:STDOUT: %.loc18_53.9: init %D to %.loc18_53.3 = class_init (%.loc18_53.5, %.loc18_53.8) [concrete = constants.%D.val.659] +// CHECK:STDOUT: %.loc18_55.1: init %D = converted %.loc18_53.1, %.loc18_53.9 [concrete = constants.%D.val.659] +// CHECK:STDOUT: %.loc18_55.2: ref %D = temporary %.loc18_53.3, %.loc18_55.1 [concrete = constants.%.aec] +// CHECK:STDOUT: %.loc18_55.3: %D = acquire_value %.loc18_55.2 [concrete = constants.%D.val.659] +// CHECK:STDOUT: %E: type = class_type @E, @E(constants.%D.val.659) [concrete = constants.%E.1a1] +// CHECK:STDOUT: %.loc18_31.2: ref %E.1a1 = temporary_storage +// CHECK:STDOUT: %.loc18_31.3: init %E.1a1 to %.loc18_31.2 = class_init () [concrete = constants.%E.val] +// CHECK:STDOUT: %.loc18_33: init %E.1a1 = converted %.loc18_31.1, %.loc18_31.3 [concrete = constants.%E.val] +// CHECK:STDOUT: %.loc18_1: %E.254 = converted %.loc18_33, [concrete = ] // CHECK:STDOUT: assign file.%g.var, // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -687,3 +690,15 @@ var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDOUT: %F.loc9_10.1 => constants.%F // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @E(constants.%D.val.525) { +// CHECK:STDOUT: %F.loc9_10.1 => constants.%D.val.525 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @E(constants.%D.val.659) { +// CHECK:STDOUT: %F.loc9_10.1 => constants.%D.val.659 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/method/method.carbon b/toolchain/check/testdata/class/method/method.carbon index 5624c1d860e7..5093003fbc15 100644 --- a/toolchain/check/testdata/class/method/method.carbon +++ b/toolchain/check/testdata/class/method/method.carbon @@ -408,7 +408,7 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %.loc39_20.2: ref %Class = temporary %.loc39_18.3, %.loc39_20.1 [concrete = constants.%.ae5] // CHECK:STDOUT: %F.ref: %Class.F.type = name_ref F, @Class.%Class.F.decl [concrete = constants.%Class.F] // CHECK:STDOUT: %Class.F.bound: = bound_method %.loc39_20.2, %F.ref [concrete = constants.%Class.F.bound] -// CHECK:STDOUT: %.loc39_20.3: %Class = acquire_value %.loc39_20.2 +// CHECK:STDOUT: %.loc39_20.3: %Class = acquire_value %.loc39_20.2 [concrete = constants.%Class.val] // CHECK:STDOUT: %Class.F.call: init %i32 = call %Class.F.bound(%.loc39_20.3) // CHECK:STDOUT: return %Class.F.call // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/deduce/generic_type.carbon b/toolchain/check/testdata/deduce/generic_type.carbon index 13adb198e216..01a8379ccdae 100644 --- a/toolchain/check/testdata/deduce/generic_type.carbon +++ b/toolchain/check/testdata/deduce/generic_type.carbon @@ -934,7 +934,7 @@ fn G() -> i32 { // CHECK:STDOUT: %.loc9_15.1: init %WithNontype.6bb = converted %.loc9_13.1, %.loc9_13.3 [concrete = constants.%WithNontype.val] // CHECK:STDOUT: %F.specific_fn: = specific_function %F.ref, @F(constants.%int_0.6a9) [concrete = constants.%F.specific_fn] // CHECK:STDOUT: %.loc9_15.2: ref %WithNontype.6bb = temporary %.loc9_13.2, %.loc9_15.1 [concrete = constants.%.0bf] -// CHECK:STDOUT: %.loc9_15.3: %WithNontype.6bb = acquire_value %.loc9_15.2 +// CHECK:STDOUT: %.loc9_15.3: %WithNontype.6bb = acquire_value %.loc9_15.2 [concrete = constants.%WithNontype.val] // CHECK:STDOUT: %F.call: init %i32 = call %F.specific_fn(%.loc9_15.3) // CHECK:STDOUT: return %F.call // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/deduce/value_with_type_through_access.carbon b/toolchain/check/testdata/deduce/value_with_type_through_access.carbon index 37a0fc759d99..1b483b850ce7 100644 --- a/toolchain/check/testdata/deduce/value_with_type_through_access.carbon +++ b/toolchain/check/testdata/deduce/value_with_type_through_access.carbon @@ -74,13 +74,6 @@ fn G(c:! Class) { } fn H() { - // CHECK:STDERR: fail_todo_class_access.carbon:[[@LINE+7]]:3: error: argument for generic parameter is not a compile-time constant [CompTimeArgumentNotConstant] - // CHECK:STDERR: G({.t = C}); - // CHECK:STDERR: ^~~~~~~~~~~ - // CHECK:STDERR: fail_todo_class_access.carbon:[[@LINE-8]]:6: note: initializing generic parameter `c` declared here [InitializingGenericParam] - // CHECK:STDERR: fn G(c:! Class) { - // CHECK:STDERR: ^~~~~~~~~ - // CHECK:STDERR: G({.t = C}); } @@ -101,13 +94,6 @@ fn F[T:! array(type, 1)](unused x: HoldsType(T), unused a: T[0]) {} class C {} fn G() { - // CHECK:STDERR: fail_todo_array_index.carbon:[[@LINE+7]]:11: error: argument for generic parameter is not a compile-time constant [CompTimeArgumentNotConstant] - // CHECK:STDERR: F({} as HoldsType((C, ) as array(type, 1)), {}); - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_todo_array_index.carbon:[[@LINE-16]]:17: note: initializing generic parameter `T` declared here [InitializingGenericParam] - // CHECK:STDERR: class HoldsType(T:! array(type, 1)) {} - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: F({} as HoldsType((C, ) as array(type, 1)), {}); } @@ -268,12 +254,12 @@ fn G() { // CHECK:STDOUT: %.loc13_30.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] // CHECK:STDOUT: %F.specific_fn: = specific_function %F.ref, @F(constants.%tuple.1f1) [concrete = constants.%F.specific_fn] // CHECK:STDOUT: %.loc13_8.2: ref %HoldsType.a31 = temporary %.loc13_6.2, %.loc13_8.1 [concrete = constants.%.31a] -// CHECK:STDOUT: %.loc13_8.3: %HoldsType.a31 = acquire_value %.loc13_8.2 +// CHECK:STDOUT: %.loc13_8.3: %HoldsType.a31 = acquire_value %.loc13_8.2 [concrete = constants.%HoldsType.val] // CHECK:STDOUT: %.loc13_30.2: ref %C = temporary_storage // CHECK:STDOUT: %.loc13_30.3: init %C to %.loc13_30.2 = class_init () [concrete = constants.%C.val] // CHECK:STDOUT: %.loc13_30.4: init %C = converted %.loc13_30.1, %.loc13_30.3 [concrete = constants.%C.val] // CHECK:STDOUT: %.loc13_30.5: ref %C = temporary %.loc13_30.2, %.loc13_30.4 [concrete = constants.%.5ea] -// CHECK:STDOUT: %.loc13_30.6: %C = acquire_value %.loc13_30.5 +// CHECK:STDOUT: %.loc13_30.6: %C = acquire_value %.loc13_30.5 [concrete = constants.%C.val] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn(%.loc13_8.3, %.loc13_30.6) // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -465,12 +451,12 @@ fn G() { // CHECK:STDOUT: %.loc13_33.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] // CHECK:STDOUT: %F.specific_fn: = specific_function %F.ref, @F(constants.%struct) [concrete = constants.%F.specific_fn] // CHECK:STDOUT: %.loc13_8.2: ref %HoldsType.673 = temporary %.loc13_6.2, %.loc13_8.1 [concrete = constants.%.41d] -// CHECK:STDOUT: %.loc13_8.3: %HoldsType.673 = acquire_value %.loc13_8.2 +// CHECK:STDOUT: %.loc13_8.3: %HoldsType.673 = acquire_value %.loc13_8.2 [concrete = constants.%HoldsType.val] // CHECK:STDOUT: %.loc13_33.2: ref %C = temporary_storage // CHECK:STDOUT: %.loc13_33.3: init %C to %.loc13_33.2 = class_init () [concrete = constants.%C.val] // CHECK:STDOUT: %.loc13_33.4: init %C = converted %.loc13_33.1, %.loc13_33.3 [concrete = constants.%C.val] // CHECK:STDOUT: %.loc13_33.5: ref %C = temporary %.loc13_33.2, %.loc13_33.4 [concrete = constants.%.5ea] -// CHECK:STDOUT: %.loc13_33.6: %C = acquire_value %.loc13_33.5 +// CHECK:STDOUT: %.loc13_33.6: %C = acquire_value %.loc13_33.5 [concrete = constants.%C.val] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn(%.loc13_8.3, %.loc13_33.6) // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -523,6 +509,7 @@ fn G() { // CHECK:STDOUT: %pattern_type.904: type = pattern_type %Class [concrete] // CHECK:STDOUT: %T.d7d: %Class = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %HoldsType.type: type = generic_class_type @HoldsType [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %HoldsType.generic: %HoldsType.type = struct_value () [concrete] // CHECK:STDOUT: %HoldsType.47b504.1: type = class_type @HoldsType, @HoldsType(%T.d7d) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] @@ -539,7 +526,7 @@ fn G() { // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete] // CHECK:STDOUT: %HoldsType.47b504.2: type = class_type @HoldsType, @HoldsType(%c) [symbolic] // CHECK:STDOUT: %require_complete.9b8c71.2: = require_complete_type %HoldsType.47b504.2 [symbolic] -// CHECK:STDOUT: %HoldsType.val: %HoldsType.47b504.2 = struct_value () [symbolic] +// CHECK:STDOUT: %HoldsType.val.e01: %HoldsType.47b504.2 = struct_value () [symbolic] // CHECK:STDOUT: %H.type: type = fn_type @H [concrete] // CHECK:STDOUT: %H: %H.type = struct_value () [concrete] // CHECK:STDOUT: %struct: %struct_type.t = struct_value (%C) [concrete] @@ -553,7 +540,10 @@ fn G() { // CHECK:STDOUT: %type.as.Copy.impl.Op.bound: = bound_method %C, %type.as.Copy.impl.Op [concrete] // CHECK:STDOUT: %Class.val: %Class = struct_value (%C) [concrete] // CHECK:STDOUT: %.2e2: ref %Class = temporary invalid, %Class.val [concrete] +// CHECK:STDOUT: %G.specific_fn: = specific_function %G, @G(%Class.val) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %HoldsType.317: type = class_type @HoldsType, @HoldsType(%Class.val) [concrete] +// CHECK:STDOUT: %HoldsType.val.b6d: %HoldsType.317 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -685,7 +675,7 @@ fn G() { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %HoldsType.loc26_22.2: type = class_type @HoldsType, @HoldsType(%c.loc25_7.1) [symbolic = %HoldsType.loc26_22.2 (constants.%HoldsType.47b504.2)] // CHECK:STDOUT: %require_complete: = require_complete_type %HoldsType.loc26_22.2 [symbolic = %require_complete (constants.%require_complete.9b8c71.2)] -// CHECK:STDOUT: %HoldsType.val: @G.%HoldsType.loc26_22.2 (%HoldsType.47b504.2) = struct_value () [symbolic = %HoldsType.val (constants.%HoldsType.val)] +// CHECK:STDOUT: %HoldsType.val: @G.%HoldsType.loc26_22.2 (%HoldsType.47b504.2) = struct_value () [symbolic = %HoldsType.val (constants.%HoldsType.val.e01)] // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: @@ -695,8 +685,8 @@ fn G() { // CHECK:STDOUT: %c.ref: %Class = name_ref c, %c.loc25_7.2 [symbolic = %c.loc25_7.1 (constants.%c)] // CHECK:STDOUT: %HoldsType.loc26_22.1: type = class_type @HoldsType, @HoldsType(constants.%c) [symbolic = %HoldsType.loc26_22.2 (constants.%HoldsType.47b504.2)] // CHECK:STDOUT: %.loc26_6.2: ref @G.%HoldsType.loc26_22.2 (%HoldsType.47b504.2) = temporary_storage -// CHECK:STDOUT: %.loc26_6.3: init @G.%HoldsType.loc26_22.2 (%HoldsType.47b504.2) to %.loc26_6.2 = class_init () [symbolic = %HoldsType.val (constants.%HoldsType.val)] -// CHECK:STDOUT: %.loc26_8: init @G.%HoldsType.loc26_22.2 (%HoldsType.47b504.2) = converted %.loc26_6.1, %.loc26_6.3 [symbolic = %HoldsType.val (constants.%HoldsType.val)] +// CHECK:STDOUT: %.loc26_6.3: init @G.%HoldsType.loc26_22.2 (%HoldsType.47b504.2) to %.loc26_6.2 = class_init () [symbolic = %HoldsType.val (constants.%HoldsType.val.e01)] +// CHECK:STDOUT: %.loc26_8: init @G.%HoldsType.loc26_22.2 (%HoldsType.47b504.2) = converted %.loc26_6.1, %.loc26_6.3 [symbolic = %HoldsType.val (constants.%HoldsType.val.e01)] // CHECK:STDOUT: %.loc26_26: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -706,17 +696,19 @@ fn G() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %G.ref: %G.type = name_ref G, file.%G.decl [concrete = constants.%G] // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %.loc37_12.1: %struct_type.t = struct_literal (%C.ref) [concrete = constants.%struct] +// CHECK:STDOUT: %.loc30_12.1: %struct_type.t = struct_literal (%C.ref) [concrete = constants.%struct] // CHECK:STDOUT: %impl.elem0: %.070 = impl_witness_access constants.%Copy.impl_witness.b47, element0 [concrete = constants.%type.as.Copy.impl.Op] // CHECK:STDOUT: %bound_method: = bound_method %C.ref, %impl.elem0 [concrete = constants.%type.as.Copy.impl.Op.bound] // CHECK:STDOUT: %type.as.Copy.impl.Op.call: init type = call %bound_method(%C.ref) [concrete = constants.%C] -// CHECK:STDOUT: %.loc37_12.2: ref %Class = temporary_storage -// CHECK:STDOUT: %.loc37_12.3: ref type = class_element_access %.loc37_12.2, element0 -// CHECK:STDOUT: %.loc37_12.4: init type to %.loc37_12.3 = in_place_init %type.as.Copy.impl.Op.call [concrete = constants.%C] -// CHECK:STDOUT: %.loc37_12.5: init %Class to %.loc37_12.2 = class_init (%.loc37_12.4) [concrete = constants.%Class.val] -// CHECK:STDOUT: %.loc37_13.1: init %Class = converted %.loc37_12.1, %.loc37_12.5 [concrete = constants.%Class.val] -// CHECK:STDOUT: %.loc37_13.2: ref %Class = temporary %.loc37_12.2, %.loc37_13.1 [concrete = constants.%.2e2] -// CHECK:STDOUT: %.loc37_13.3: %Class = acquire_value %.loc37_13.2 +// CHECK:STDOUT: %.loc30_12.2: ref %Class = temporary_storage +// CHECK:STDOUT: %.loc30_12.3: ref type = class_element_access %.loc30_12.2, element0 +// CHECK:STDOUT: %.loc30_12.4: init type to %.loc30_12.3 = in_place_init %type.as.Copy.impl.Op.call [concrete = constants.%C] +// CHECK:STDOUT: %.loc30_12.5: init %Class to %.loc30_12.2 = class_init (%.loc30_12.4) [concrete = constants.%Class.val] +// CHECK:STDOUT: %.loc30_13.1: init %Class = converted %.loc30_12.1, %.loc30_12.5 [concrete = constants.%Class.val] +// CHECK:STDOUT: %.loc30_13.2: ref %Class = temporary %.loc30_12.2, %.loc30_13.1 [concrete = constants.%.2e2] +// CHECK:STDOUT: %.loc30_13.3: %Class = acquire_value %.loc30_13.2 [concrete = constants.%Class.val] +// CHECK:STDOUT: %G.specific_fn: = specific_function %G.ref, @G(constants.%Class.val) [concrete = constants.%G.specific_fn] +// CHECK:STDOUT: %G.call: init %empty_tuple.type = call %G.specific_fn() // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -745,6 +737,21 @@ fn G() { // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @G(constants.%Class.val) { +// CHECK:STDOUT: %c.loc25_7.1 => constants.%Class.val +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %HoldsType.loc26_22.2 => constants.%HoldsType.317 +// CHECK:STDOUT: %require_complete => constants.%complete_type.357 +// CHECK:STDOUT: %HoldsType.val => constants.%HoldsType.val.b6d +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @HoldsType(constants.%Class.val) { +// CHECK:STDOUT: %T.loc8_18.1 => constants.%Class.val +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_array_index.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -756,10 +763,10 @@ fn G() { // CHECK:STDOUT: %T.9b7: %array_type = symbolic_binding T, 0 [symbolic] // CHECK:STDOUT: %HoldsType.type: type = generic_class_type @HoldsType [concrete] // CHECK:STDOUT: %HoldsType.generic: %HoldsType.type = struct_value () [concrete] -// CHECK:STDOUT: %HoldsType: type = class_type @HoldsType, @HoldsType(%T.9b7) [symbolic] +// CHECK:STDOUT: %HoldsType.ad8: type = class_type @HoldsType, @HoldsType(%T.9b7) [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] -// CHECK:STDOUT: %pattern_type.342: type = pattern_type %HoldsType [symbolic] +// CHECK:STDOUT: %pattern_type.342: type = pattern_type %HoldsType.ad8 [symbolic] // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] @@ -783,7 +790,7 @@ fn G() { // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] -// CHECK:STDOUT: %require_complete.bd5: = require_complete_type %HoldsType [symbolic] +// CHECK:STDOUT: %require_complete.bd5: = require_complete_type %HoldsType.ad8 [symbolic] // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] @@ -800,6 +807,8 @@ fn G() { // CHECK:STDOUT: %type.as.Copy.impl.Op.bound: = bound_method %C, %type.as.Copy.impl.Op [concrete] // CHECK:STDOUT: %array: %array_type = tuple_value (%C) [concrete] // CHECK:STDOUT: %.296: ref %array_type = temporary invalid, %array [concrete] +// CHECK:STDOUT: %HoldsType.d1a: type = class_type @HoldsType, @HoldsType(%array) [concrete] +// CHECK:STDOUT: %HoldsType.val: %HoldsType.d1a = struct_value () [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -856,13 +865,13 @@ fn G() { // CHECK:STDOUT: %array_type: type = array_type %int_1, %.loc12_16 [concrete = constants.%array_type] // CHECK:STDOUT: } // CHECK:STDOUT: %T.loc12_7.2: %array_type = symbolic_binding T, 0 [symbolic = %T.loc12_7.1 (constants.%T.9b7)] -// CHECK:STDOUT: %x.param: @F.%HoldsType.loc12_47.1 (%HoldsType) = value_param call_param0 -// CHECK:STDOUT: %.loc12_47: type = splice_block %HoldsType.loc12_47.2 [symbolic = %HoldsType.loc12_47.1 (constants.%HoldsType)] { +// CHECK:STDOUT: %x.param: @F.%HoldsType.loc12_47.1 (%HoldsType.ad8) = value_param call_param0 +// CHECK:STDOUT: %.loc12_47: type = splice_block %HoldsType.loc12_47.2 [symbolic = %HoldsType.loc12_47.1 (constants.%HoldsType.ad8)] { // CHECK:STDOUT: %HoldsType.ref: %HoldsType.type = name_ref HoldsType, file.%HoldsType.decl [concrete = constants.%HoldsType.generic] // CHECK:STDOUT: %T.ref.loc12_46: %array_type = name_ref T, %T.loc12_7.2 [symbolic = %T.loc12_7.1 (constants.%T.9b7)] -// CHECK:STDOUT: %HoldsType.loc12_47.2: type = class_type @HoldsType, @HoldsType(constants.%T.9b7) [symbolic = %HoldsType.loc12_47.1 (constants.%HoldsType)] +// CHECK:STDOUT: %HoldsType.loc12_47.2: type = class_type @HoldsType, @HoldsType(constants.%T.9b7) [symbolic = %HoldsType.loc12_47.1 (constants.%HoldsType.ad8)] // CHECK:STDOUT: } -// CHECK:STDOUT: %x: @F.%HoldsType.loc12_47.1 (%HoldsType) = value_binding x, %x.param +// CHECK:STDOUT: %x: @F.%HoldsType.loc12_47.1 (%HoldsType.ad8) = value_binding x, %x.param // CHECK:STDOUT: %a.param: = value_param call_param1 // CHECK:STDOUT: %.1: = splice_block [concrete = ] { // CHECK:STDOUT: %T.ref.loc12_60: %array_type = name_ref T, %T.loc12_7.2 [symbolic = %T.loc12_7.1 (constants.%T.9b7)] @@ -894,7 +903,7 @@ fn G() { // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%HoldsType +// CHECK:STDOUT: .Self = constants.%HoldsType.ad8 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -908,13 +917,13 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%T.loc12_7.2: %array_type) { // CHECK:STDOUT: %T.loc12_7.1: %array_type = symbolic_binding T, 0 [symbolic = %T.loc12_7.1 (constants.%T.9b7)] -// CHECK:STDOUT: %HoldsType.loc12_47.1: type = class_type @HoldsType, @HoldsType(%T.loc12_7.1) [symbolic = %HoldsType.loc12_47.1 (constants.%HoldsType)] +// CHECK:STDOUT: %HoldsType.loc12_47.1: type = class_type @HoldsType, @HoldsType(%T.loc12_7.1) [symbolic = %HoldsType.loc12_47.1 (constants.%HoldsType.ad8)] // CHECK:STDOUT: %pattern_type: type = pattern_type %HoldsType.loc12_47.1 [symbolic = %pattern_type (constants.%pattern_type.342)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete: = require_complete_type %HoldsType.loc12_47.1 [symbolic = %require_complete (constants.%require_complete.bd5)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%x.param: @F.%HoldsType.loc12_47.1 (%HoldsType), %a.param: ) { +// CHECK:STDOUT: fn(%x.param: @F.%HoldsType.loc12_47.1 (%HoldsType.ad8), %a.param: ) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -923,25 +932,29 @@ fn G() { // CHECK:STDOUT: fn @G() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] -// CHECK:STDOUT: %.loc24_6: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc17_6.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] // CHECK:STDOUT: %HoldsType.ref: %HoldsType.type = name_ref HoldsType, file.%HoldsType.decl [concrete = constants.%HoldsType.generic] // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %.loc24_25.1: %tuple.type.85c = tuple_literal (%C.ref) [concrete = constants.%tuple.1f1] -// CHECK:STDOUT: %.loc24_36: type = type_literal type [concrete = type] +// CHECK:STDOUT: %.loc17_25.1: %tuple.type.85c = tuple_literal (%C.ref) [concrete = constants.%tuple.1f1] +// CHECK:STDOUT: %.loc17_36: type = type_literal type [concrete = type] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] -// CHECK:STDOUT: %array_type: type = array_type %int_1, %.loc24_36 [concrete = constants.%array_type] +// CHECK:STDOUT: %array_type: type = array_type %int_1, %.loc17_36 [concrete = constants.%array_type] // CHECK:STDOUT: %impl.elem0: %.070 = impl_witness_access constants.%Copy.impl_witness.b47, element0 [concrete = constants.%type.as.Copy.impl.Op] // CHECK:STDOUT: %bound_method: = bound_method %C.ref, %impl.elem0 [concrete = constants.%type.as.Copy.impl.Op.bound] // CHECK:STDOUT: %type.as.Copy.impl.Op.call: init type = call %bound_method(%C.ref) [concrete = constants.%C] -// CHECK:STDOUT: %.loc24_25.2: ref %array_type = temporary_storage +// CHECK:STDOUT: %.loc17_25.2: ref %array_type = temporary_storage // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] -// CHECK:STDOUT: %.loc24_25.3: ref type = array_index %.loc24_25.2, %int_0 -// CHECK:STDOUT: %.loc24_25.4: init type to %.loc24_25.3 = in_place_init %type.as.Copy.impl.Op.call [concrete = constants.%C] -// CHECK:STDOUT: %.loc24_25.5: init %array_type to %.loc24_25.2 = array_init (%.loc24_25.4) [concrete = constants.%array] -// CHECK:STDOUT: %.loc24_27.1: init %array_type = converted %.loc24_25.1, %.loc24_25.5 [concrete = constants.%array] -// CHECK:STDOUT: %.loc24_27.2: ref %array_type = temporary %.loc24_25.2, %.loc24_27.1 [concrete = constants.%.296] -// CHECK:STDOUT: %.loc24_27.3: %array_type = acquire_value %.loc24_27.2 -// CHECK:STDOUT: %.loc24_48: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc17_25.3: ref type = array_index %.loc17_25.2, %int_0 +// CHECK:STDOUT: %.loc17_25.4: init type to %.loc17_25.3 = in_place_init %type.as.Copy.impl.Op.call [concrete = constants.%C] +// CHECK:STDOUT: %.loc17_25.5: init %array_type to %.loc17_25.2 = array_init (%.loc17_25.4) [concrete = constants.%array] +// CHECK:STDOUT: %.loc17_27.1: init %array_type = converted %.loc17_25.1, %.loc17_25.5 [concrete = constants.%array] +// CHECK:STDOUT: %.loc17_27.2: ref %array_type = temporary %.loc17_25.2, %.loc17_27.1 [concrete = constants.%.296] +// CHECK:STDOUT: %.loc17_27.3: %array_type = acquire_value %.loc17_27.2 [concrete = constants.%array] +// CHECK:STDOUT: %HoldsType: type = class_type @HoldsType, @HoldsType(constants.%array) [concrete = constants.%HoldsType.d1a] +// CHECK:STDOUT: %.loc17_6.2: ref %HoldsType.d1a = temporary_storage +// CHECK:STDOUT: %.loc17_6.3: init %HoldsType.d1a to %.loc17_6.2 = class_init () [concrete = constants.%HoldsType.val] +// CHECK:STDOUT: %.loc17_8: init %HoldsType.d1a = converted %.loc17_6.1, %.loc17_6.3 [concrete = constants.%HoldsType.val] +// CHECK:STDOUT: %.loc17_48: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -955,7 +968,13 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T.9b7) { // CHECK:STDOUT: %T.loc12_7.1 => constants.%T.9b7 -// CHECK:STDOUT: %HoldsType.loc12_47.1 => constants.%HoldsType +// CHECK:STDOUT: %HoldsType.loc12_47.1 => constants.%HoldsType.ad8 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.342 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: specific @HoldsType(constants.%array) { +// CHECK:STDOUT: %T.loc4_18.1 => constants.%array +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/eval/binding.carbon b/toolchain/check/testdata/eval/binding.carbon index 1ec60ee47e80..c4aa3798b04f 100644 --- a/toolchain/check/testdata/eval/binding.carbon +++ b/toolchain/check/testdata/eval/binding.carbon @@ -183,7 +183,7 @@ let n: array(i32, G()) = (1, 2, 3); // CHECK:STDOUT: %.loc11_35.11: init %array_type to %.loc11_35.2 = array_init (%.loc11_35.4, %.loc11_35.7, %.loc11_35.10) [concrete = constants.%array] // CHECK:STDOUT: %.loc11_35.12: init %array_type = converted @__global_init.%.loc11, %.loc11_35.11 [concrete = constants.%array] // CHECK:STDOUT: %.loc11_35.13: ref %array_type = temporary %.loc11_35.2, %.loc11_35.12 [concrete = constants.%.fd3] -// CHECK:STDOUT: %.loc11_35.14: %array_type = acquire_value %.loc11_35.13 +// CHECK:STDOUT: %.loc11_35.14: %array_type = acquire_value %.loc11_35.13 [concrete = constants.%array] // CHECK:STDOUT: %n: %array_type = value_binding n, %.loc11_35.14 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/eval/call.carbon b/toolchain/check/testdata/eval/call.carbon index 37bbeda59e83..97a2ebce9b2e 100644 --- a/toolchain/check/testdata/eval/call.carbon +++ b/toolchain/check/testdata/eval/call.carbon @@ -155,7 +155,7 @@ fn H() { //@dump-sem-ir-end } -// --- fail_todo_return_in_place_class.carbon +// --- return_in_place_class.carbon library "[[@TEST_NAME]]"; @@ -167,15 +167,7 @@ eval fn F() -> C { return {}; } fn G(_:! C) {} fn H() { - // TODO: The call to the function is a constant, but the `temporary` instruction wrapping it is not. //@dump-sem-ir-begin - // CHECK:STDERR: fail_todo_return_in_place_class.carbon:[[@LINE+7]]:3: error: argument for generic parameter is not a compile-time constant [CompTimeArgumentNotConstant] - // CHECK:STDERR: G(F()); - // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_todo_return_in_place_class.carbon:[[@LINE-8]]:6: note: initializing generic parameter `_` declared here [InitializingGenericParam] - // CHECK:STDERR: fn G(_:! C) {} - // CHECK:STDERR: ^~~~~ - // CHECK:STDERR: G(F()); //@dump-sem-ir-end } @@ -368,7 +360,7 @@ fn H() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %tuple.type.189) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: --- fail_todo_return_in_place_class.carbon +// CHECK:STDOUT: --- return_in_place_class.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [concrete] @@ -376,12 +368,14 @@ fn H() { // CHECK:STDOUT: %.a69: Core.Form = init_form %C [concrete] // CHECK:STDOUT: %pattern_type.7c7: type = pattern_type %C [concrete] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete] // CHECK:STDOUT: %C.val: %C = struct_value () [concrete] // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] // CHECK:STDOUT: %.5ea: ref %C = temporary invalid, %C.val [concrete] +// CHECK:STDOUT: %G.specific_fn: = specific_function %G, @G(%C.val) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -408,10 +402,12 @@ fn H() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %G.ref: %G.type = name_ref G, file.%G.decl [concrete = constants.%G] // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] -// CHECK:STDOUT: %.loc21_7.1: ref %C = temporary_storage -// CHECK:STDOUT: %F.call: init %C to %.loc21_7.1 = call %F.ref() [concrete = constants.%C.val] -// CHECK:STDOUT: %.loc21_7.2: ref %C = temporary %.loc21_7.1, %F.call [concrete = constants.%.5ea] -// CHECK:STDOUT: %.loc21_7.3: %C = acquire_value %.loc21_7.2 +// CHECK:STDOUT: %.loc13_7.1: ref %C = temporary_storage +// CHECK:STDOUT: %F.call: init %C to %.loc13_7.1 = call %F.ref() [concrete = constants.%C.val] +// CHECK:STDOUT: %.loc13_7.2: ref %C = temporary %.loc13_7.1, %F.call [concrete = constants.%.5ea] +// CHECK:STDOUT: %.loc13_7.3: %C = acquire_value %.loc13_7.2 [concrete = constants.%C.val] +// CHECK:STDOUT: %G.specific_fn: = specific_function %G.ref, @G(constants.%C.val) [concrete = constants.%G.specific_fn] +// CHECK:STDOUT: %G.call: init %empty_tuple.type = call %G.specific_fn() // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/facet/call_combined_impl_witness.carbon b/toolchain/check/testdata/facet/call_combined_impl_witness.carbon index 51ca33a8250a..389ad06bc70a 100644 --- a/toolchain/check/testdata/facet/call_combined_impl_witness.carbon +++ b/toolchain/check/testdata/facet/call_combined_impl_witness.carbon @@ -387,7 +387,7 @@ fn F() { // CHECK:STDOUT: %.loc45_12: %facet_type.dc7 = converted constants.%C, %facet_value [concrete = constants.%facet_value] // CHECK:STDOUT: %G.specific_fn: = specific_function %G.ref, @G(constants.%facet_value) [concrete = constants.%G.specific_fn] // CHECK:STDOUT: %.loc45_8.2: ref %C = temporary %.loc45_6.2, %.loc45_8.1 [concrete = constants.%.5ea] -// CHECK:STDOUT: %.loc45_8.3: %C = acquire_value %.loc45_8.2 +// CHECK:STDOUT: %.loc45_8.3: %C = acquire_value %.loc45_8.2 [concrete = constants.%C.val] // CHECK:STDOUT: %G.call: init %empty_tuple.type = call %G.specific_fn(%.loc45_8.3) // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/facet/convert_class_type_to_generic_facet_value.carbon b/toolchain/check/testdata/facet/convert_class_type_to_generic_facet_value.carbon index 59325f0bca0a..fdefe8af926c 100644 --- a/toolchain/check/testdata/facet/convert_class_type_to_generic_facet_value.carbon +++ b/toolchain/check/testdata/facet/convert_class_type_to_generic_facet_value.carbon @@ -610,7 +610,7 @@ fn G() { // CHECK:STDOUT: %.loc18_53: %Generic.type.498 = converted constants.%ImplsGeneric, %Generic.facet [concrete = constants.%Generic.facet] // CHECK:STDOUT: %CallGenericMethod.specific_fn: = specific_function %CallGenericMethod.ref, @CallGenericMethod(constants.%GenericParam, constants.%Generic.facet) [concrete = constants.%CallGenericMethod.specific_fn] // CHECK:STDOUT: %.loc18_38.2: ref %GenericParam = temporary %.loc18_36.2, %.loc18_38.1 [concrete = constants.%.601] -// CHECK:STDOUT: %.loc18_38.3: %GenericParam = acquire_value %.loc18_38.2 +// CHECK:STDOUT: %.loc18_38.3: %GenericParam = acquire_value %.loc18_38.2 [concrete = constants.%GenericParam.val] // CHECK:STDOUT: %CallGenericMethod.call: init %empty_tuple.type = call %CallGenericMethod.specific_fn(%.loc18_38.3) // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/facet/convert_class_value_to_facet_value_value.carbon b/toolchain/check/testdata/facet/convert_class_value_to_facet_value_value.carbon index e3e713bc265c..a704db158f0f 100644 --- a/toolchain/check/testdata/facet/convert_class_value_to_facet_value_value.carbon +++ b/toolchain/check/testdata/facet/convert_class_value_to_facet_value_value.carbon @@ -151,7 +151,7 @@ fn F() { // CHECK:STDOUT: %.loc23_24: %Animal.type = converted constants.%Goat, %Animal.facet [concrete = constants.%Animal.facet] // CHECK:STDOUT: %WalkAnimal.specific_fn: = specific_function %WalkAnimal.ref, @WalkAnimal(constants.%Animal.facet) [concrete = constants.%WalkAnimal.specific_fn] // CHECK:STDOUT: %.loc23_17.2: ref %Goat = temporary %.loc23_15.2, %.loc23_17.1 [concrete = constants.%.aec] -// CHECK:STDOUT: %.loc23_17.3: %Goat = acquire_value %.loc23_17.2 +// CHECK:STDOUT: %.loc23_17.3: %Goat = acquire_value %.loc23_17.2 [concrete = constants.%Goat.val] // CHECK:STDOUT: %WalkAnimal.call: init %empty_tuple.type = call %WalkAnimal.specific_fn(%.loc23_17.3) // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/facet/convert_class_value_to_generic_facet_value_value.carbon b/toolchain/check/testdata/facet/convert_class_value_to_generic_facet_value_value.carbon index 0d12b4e5b8f4..7b203b5e627a 100644 --- a/toolchain/check/testdata/facet/convert_class_value_to_generic_facet_value_value.carbon +++ b/toolchain/check/testdata/facet/convert_class_value_to_generic_facet_value_value.carbon @@ -346,9 +346,9 @@ fn B() { // CHECK:STDOUT: %.loc20_59: %Generic.type.498 = converted constants.%ImplsGeneric, %Generic.facet [concrete = constants.%Generic.facet] // CHECK:STDOUT: %CallGenericMethod.specific_fn: = specific_function %CallGenericMethod.ref, @CallGenericMethod(constants.%GenericParam, constants.%Generic.facet) [concrete = constants.%CallGenericMethod.specific_fn] // CHECK:STDOUT: %.loc20_24.2: ref %ImplsGeneric = temporary %.loc20_22.2, %.loc20_24.1 [concrete = constants.%.80a] -// CHECK:STDOUT: %.loc20_24.3: %ImplsGeneric = acquire_value %.loc20_24.2 +// CHECK:STDOUT: %.loc20_24.3: %ImplsGeneric = acquire_value %.loc20_24.2 [concrete = constants.%ImplsGeneric.val] // CHECK:STDOUT: %.loc20_44.2: ref %GenericParam = temporary %.loc20_42.2, %.loc20_44.1 [concrete = constants.%.601] -// CHECK:STDOUT: %.loc20_44.3: %GenericParam = acquire_value %.loc20_44.2 +// CHECK:STDOUT: %.loc20_44.3: %GenericParam = acquire_value %.loc20_44.2 [concrete = constants.%GenericParam.val] // CHECK:STDOUT: %CallGenericMethod.call: init %empty_tuple.type = call %CallGenericMethod.specific_fn(%.loc20_24.3, %.loc20_44.3) // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -652,7 +652,7 @@ fn B() { // CHECK:STDOUT: %.loc12_12: %I.type.5f7 = converted constants.%C, %I.facet [concrete = constants.%I.facet.0e1] // CHECK:STDOUT: %A.specific_fn: = specific_function %A.ref, @A(constants.%I.facet.0e1) [concrete = constants.%A.specific_fn] // CHECK:STDOUT: %.loc12_8.2: ref %C = temporary %.loc12_6.2, %.loc12_8.1 [concrete = constants.%.5ea] -// CHECK:STDOUT: %.loc12_8.3: %C = acquire_value %.loc12_8.2 +// CHECK:STDOUT: %.loc12_8.3: %C = acquire_value %.loc12_8.2 [concrete = constants.%C.val] // CHECK:STDOUT: %A.call: init %empty_tuple.type = call %A.specific_fn(%.loc12_8.3) // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/facet/convert_facet_value_as_type_knows_original_type.carbon b/toolchain/check/testdata/facet/convert_facet_value_as_type_knows_original_type.carbon index f9df0b0b3e75..cd28113c5ed4 100644 --- a/toolchain/check/testdata/facet/convert_facet_value_as_type_knows_original_type.carbon +++ b/toolchain/check/testdata/facet/convert_facet_value_as_type_knows_original_type.carbon @@ -169,7 +169,7 @@ fn F[A:! J, B:! A](x: C(A, B)) { // CHECK:STDOUT: %.loc22_15.3: type = converted %.loc22_15.2, %as_type.loc22 [concrete = constants.%Goat] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc22_30.2: ref %Goat = temporary %.loc22_28.2, %.loc22_30.1 [concrete = constants.%.aec] -// CHECK:STDOUT: %.loc22_30.3: %Goat = acquire_value %.loc22_30.2 +// CHECK:STDOUT: %.loc22_30.3: %Goat = acquire_value %.loc22_30.2 [concrete = constants.%Goat.val] // CHECK:STDOUT: %x: %Goat = value_binding x, %.loc22_30.3 // CHECK:STDOUT: %x.ref.loc23: %Goat = name_ref x, %x // CHECK:STDOUT: %Bleet.ref.loc23: %Goat.Bleet.type = name_ref Bleet, @Goat.%Goat.Bleet.decl [concrete = constants.%Goat.Bleet] diff --git a/toolchain/check/testdata/facet/convert_facet_value_value_to_generic_facet_value_value.carbon b/toolchain/check/testdata/facet/convert_facet_value_value_to_generic_facet_value_value.carbon index 8b17eb434e4d..3ecb865b8864 100644 --- a/toolchain/check/testdata/facet/convert_facet_value_value_to_generic_facet_value_value.carbon +++ b/toolchain/check/testdata/facet/convert_facet_value_value_to_generic_facet_value_value.carbon @@ -424,9 +424,9 @@ fn F() { // CHECK:STDOUT: %.loc35_39.2: %Edible.type = converted constants.%Grass, %Edible.facet [concrete = constants.%Edible.facet] // CHECK:STDOUT: %HandleAnimal.specific_fn: = specific_function %HandleAnimal.ref, @HandleAnimal(constants.%Animal.facet, constants.%Edible.facet) [concrete = constants.%HandleAnimal.specific_fn] // CHECK:STDOUT: %.loc35_19.2: ref %Goat = temporary %.loc35_17.2, %.loc35_19.1 [concrete = constants.%.aec] -// CHECK:STDOUT: %.loc35_19.3: %Goat = acquire_value %.loc35_19.2 +// CHECK:STDOUT: %.loc35_19.3: %Goat = acquire_value %.loc35_19.2 [concrete = constants.%Goat.val] // CHECK:STDOUT: %.loc35_31.2: ref %Grass = temporary %.loc35_29.2, %.loc35_31.1 [concrete = constants.%.cf4] -// CHECK:STDOUT: %.loc35_31.3: %Grass = acquire_value %.loc35_31.2 +// CHECK:STDOUT: %.loc35_31.3: %Grass = acquire_value %.loc35_31.2 [concrete = constants.%Grass.val] // CHECK:STDOUT: %HandleAnimal.call: init %empty_tuple.type = call %HandleAnimal.specific_fn(%.loc35_19.3, %.loc35_31.3) // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/facet/convert_facet_value_value_to_itself.carbon b/toolchain/check/testdata/facet/convert_facet_value_value_to_itself.carbon index 0cc773f6be5c..75d76fb183e9 100644 --- a/toolchain/check/testdata/facet/convert_facet_value_value_to_itself.carbon +++ b/toolchain/check/testdata/facet/convert_facet_value_value_to_itself.carbon @@ -196,7 +196,7 @@ fn F() { // CHECK:STDOUT: %.loc25_26: %Animal.type = converted constants.%Goat, %Animal.facet [concrete = constants.%Animal.facet] // CHECK:STDOUT: %HandleAnimal.specific_fn: = specific_function %HandleAnimal.ref, @HandleAnimal(constants.%Animal.facet) [concrete = constants.%HandleAnimal.specific_fn] // CHECK:STDOUT: %.loc25_19.2: ref %Goat = temporary %.loc25_17.2, %.loc25_19.1 [concrete = constants.%.aec] -// CHECK:STDOUT: %.loc25_19.3: %Goat = acquire_value %.loc25_19.2 +// CHECK:STDOUT: %.loc25_19.3: %Goat = acquire_value %.loc25_19.2 [concrete = constants.%Goat.val] // CHECK:STDOUT: %HandleAnimal.call: init %empty_tuple.type = call %HandleAnimal.specific_fn(%.loc25_19.3) // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/for/basic.carbon b/toolchain/check/testdata/for/basic.carbon index 00a6743352e2..635034eeb468 100644 --- a/toolchain/check/testdata/for/basic.carbon +++ b/toolchain/check/testdata/for/basic.carbon @@ -94,7 +94,8 @@ fn Run() { // CHECK:STDOUT: %TrivialRange.val: %TrivialRange = struct_value () [concrete] // CHECK:STDOUT: %.401: ref %TrivialRange = temporary invalid, %TrivialRange.val [concrete] // CHECK:STDOUT: %.ccd: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.a3c, %Iterate.facet [concrete] -// CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.bound: = bound_method %.401, %TrivialRange.as.Iterate.impl.NewCursor.c71f42.2 [concrete] +// CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.bound.fe4: = bound_method %.401, %TrivialRange.as.Iterate.impl.NewCursor.c71f42.2 [concrete] +// CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.bound.28d: = bound_method %TrivialRange.val, %TrivialRange.as.Iterate.impl.NewCursor.c71f42.1 [concrete] // CHECK:STDOUT: %.827: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.9dc, %Iterate.facet [concrete] // CHECK:STDOUT: %TrivialRange.as.Iterate.impl.Next.bound: = bound_method %.401, %TrivialRange.as.Iterate.impl.Next [concrete] // CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %Optional.HasValue.4fc, @Optional.HasValue(%Copy.facet) [concrete] @@ -126,10 +127,10 @@ fn Run() { // CHECK:STDOUT: %.loc18_20.1: init %TrivialRange = converted %.loc18_18.1, %.loc18_18.3 [concrete = constants.%TrivialRange.val] // CHECK:STDOUT: %.loc18_20.2: ref %TrivialRange = temporary %.loc18_18.2, %.loc18_20.1 [concrete = constants.%.401] // CHECK:STDOUT: %impl.elem2: %.ccd = impl_witness_access constants.%Iterate.impl_witness, element2 [concrete = constants.%TrivialRange.as.Iterate.impl.NewCursor.c71f42.2] -// CHECK:STDOUT: %bound_method.loc18_35.1: = bound_method %.loc18_20.2, %impl.elem2 [concrete = constants.%TrivialRange.as.Iterate.impl.NewCursor.bound] -// CHECK:STDOUT: %.loc18_20.3: %TrivialRange = acquire_value %.loc18_20.2 +// CHECK:STDOUT: %bound_method.loc18_35.1: = bound_method %.loc18_20.2, %impl.elem2 [concrete = constants.%TrivialRange.as.Iterate.impl.NewCursor.bound.fe4] +// CHECK:STDOUT: %.loc18_20.3: %TrivialRange = acquire_value %.loc18_20.2 [concrete = constants.%TrivialRange.val] // CHECK:STDOUT: %NewCursor.ref: %TrivialRange.as.Iterate.impl.NewCursor.type.408fa8.1 = name_ref NewCursor, @TrivialRange.as.Iterate.impl.%TrivialRange.as.Iterate.impl.NewCursor.decl.loc6_39.1 [concrete = constants.%TrivialRange.as.Iterate.impl.NewCursor.c71f42.1] -// CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.bound: = bound_method %.loc18_20.3, %NewCursor.ref +// CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.bound: = bound_method %.loc18_20.3, %NewCursor.ref [concrete = constants.%TrivialRange.as.Iterate.impl.NewCursor.bound.28d] // CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.call: init %empty_tuple.type = call %TrivialRange.as.Iterate.impl.NewCursor.bound(%.loc18_20.3) // CHECK:STDOUT: %var: ref %empty_tuple.type = var invalid // CHECK:STDOUT: assign %var, %TrivialRange.as.Iterate.impl.NewCursor.call @@ -140,7 +141,7 @@ fn Run() { // CHECK:STDOUT: %impl.elem3: %.827 = impl_witness_access constants.%Iterate.impl_witness, element3 [concrete = constants.%TrivialRange.as.Iterate.impl.Next] // CHECK:STDOUT: %bound_method.loc18_35.2: = bound_method %.loc18_20.2, %impl.elem3 [concrete = constants.%TrivialRange.as.Iterate.impl.Next.bound] // CHECK:STDOUT: %.loc18_35.1: ref %Optional.311 = temporary_storage -// CHECK:STDOUT: %.loc18_20.4: %TrivialRange = acquire_value %.loc18_20.2 +// CHECK:STDOUT: %.loc18_20.4: %TrivialRange = acquire_value %.loc18_20.2 [concrete = constants.%TrivialRange.val] // CHECK:STDOUT: %TrivialRange.as.Iterate.impl.Next.call: init %Optional.311 to %.loc18_35.1 = call %bound_method.loc18_35.2(%.loc18_20.4, %addr) // CHECK:STDOUT: %.loc18_35.2: ref %Optional.311 = temporary %.loc18_35.1, %TrivialRange.as.Iterate.impl.Next.call // CHECK:STDOUT: %.loc18_35.3: %Optional.HasValue.type.4db = specific_constant imports.%Core.import_ref.228, @Optional(constants.%Copy.facet) [concrete = constants.%Optional.HasValue.4fc] diff --git a/toolchain/check/testdata/function/generic/deduce.carbon b/toolchain/check/testdata/function/generic/deduce.carbon index 6fe676338309..a91ee6335b45 100644 --- a/toolchain/check/testdata/function/generic/deduce.carbon +++ b/toolchain/check/testdata/function/generic/deduce.carbon @@ -656,7 +656,7 @@ fn F() { // CHECK:STDOUT: %.loc11_37.3: init %A to %.loc11_37.2 = class_init () [concrete = constants.%A.val] // CHECK:STDOUT: %.loc11_37.4: init %A = converted %.loc11_37.1, %.loc11_37.3 [concrete = constants.%A.val] // CHECK:STDOUT: %.loc11_37.5: ref %A = temporary %.loc11_37.2, %.loc11_37.4 [concrete = constants.%.33f] -// CHECK:STDOUT: %.loc11_37.6: %A = acquire_value %.loc11_37.5 +// CHECK:STDOUT: %.loc11_37.6: %A = acquire_value %.loc11_37.5 [concrete = constants.%A.val] // CHECK:STDOUT: %ExplicitAndAlsoDeduced.call: init %ptr.643 = call %ExplicitAndAlsoDeduced.specific_fn(%.loc11_37.6) // CHECK:STDOUT: return %ExplicitAndAlsoDeduced.call // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/fail_impl_as_scope.carbon b/toolchain/check/testdata/impl/fail_impl_as_scope.carbon index a8360581e47f..1fd09b92d783 100644 --- a/toolchain/check/testdata/impl/fail_impl_as_scope.carbon +++ b/toolchain/check/testdata/impl/fail_impl_as_scope.carbon @@ -457,7 +457,7 @@ class X { // CHECK:STDOUT: %impl.elem1: %.429 = impl_witness_access constants.%Z.impl_witness, element1 [concrete = constants.%Point.as.Z.impl.Method] // CHECK:STDOUT: %bound_method: = bound_method %.loc29_7.1, %impl.elem1 [concrete = constants.%Point.as.Z.impl.Method.bound] // CHECK:STDOUT: %.loc29_7.2: ref %Point = temporary %.loc29_5.2, %.loc29_7.1 [concrete = constants.%.fcf] -// CHECK:STDOUT: %.loc29_7.3: %Point = acquire_value %.loc29_7.2 +// CHECK:STDOUT: %.loc29_7.3: %Point = acquire_value %.loc29_7.2 [concrete = constants.%Point.val] // CHECK:STDOUT: %Point.as.Z.impl.Method.call: init %empty_tuple.type = call %bound_method(%.loc29_7.3) // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/import_thunk.carbon b/toolchain/check/testdata/impl/import_thunk.carbon index 894c5b8dc700..2b8fa7265955 100644 --- a/toolchain/check/testdata/impl/import_thunk.carbon +++ b/toolchain/check/testdata/impl/import_thunk.carbon @@ -316,7 +316,7 @@ fn G() { // CHECK:STDOUT: %.2: init @C.as.I.impl.F.loc8_24.2.%C (%C.c8540f.2) to %.1 = class_init () [symbolic = %C.val (constants.%C.val)] // CHECK:STDOUT: %.3: init @C.as.I.impl.F.loc8_24.2.%C (%C.c8540f.2) = converted %x.param, %.2 [symbolic = %C.val (constants.%C.val)] // CHECK:STDOUT: %.4: ref @C.as.I.impl.F.loc8_24.2.%C (%C.c8540f.2) = temporary %.1, %.3 [symbolic = %.6 (constants.%.5fa)] -// CHECK:STDOUT: %.5: @C.as.I.impl.F.loc8_24.2.%C (%C.c8540f.2) = acquire_value %.4 +// CHECK:STDOUT: %.5: @C.as.I.impl.F.loc8_24.2.%C (%C.c8540f.2) = acquire_value %.4 [symbolic = %C.val (constants.%C.val)] // CHECK:STDOUT: %C.as.I.impl.F.call: init %empty_tuple.type = call %C.as.I.impl.F.specific_fn.loc8_24.1(%.5) // CHECK:STDOUT: %Op.ref: %Destroy.assoc_type = name_ref Op, imports.%Core.import_ref.06b [concrete = constants.%assoc0] // CHECK:STDOUT: %impl.elem0.1: @C.as.I.impl.F.loc8_24.2.%.7 (%.371) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.2 (constants.%impl.elem0)] @@ -547,7 +547,7 @@ fn G() { // CHECK:STDOUT: %.loc7_16.4: init %C.387 to %.loc7_16.3 = class_init () [concrete = constants.%C.val.135] // CHECK:STDOUT: %.loc7_16.5: init %C.387 = converted %.loc7_16.2, %.loc7_16.4 [concrete = constants.%C.val.135] // CHECK:STDOUT: %.loc7_16.6: ref %C.387 = temporary %.loc7_16.3, %.loc7_16.5 [concrete = constants.%.e94e] -// CHECK:STDOUT: %.loc7_16.7: %C.387 = acquire_value %.loc7_16.6 +// CHECK:STDOUT: %.loc7_16.7: %C.387 = acquire_value %.loc7_16.6 [concrete = constants.%C.val.135] // CHECK:STDOUT: %C.as.I.impl.F.call: init %empty_tuple.type = call %C.as.I.impl.F.specific_fn(%.loc7_16.7) // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/lookup/canonical_query_self.carbon b/toolchain/check/testdata/impl/lookup/canonical_query_self.carbon index e43672e62cc4..b2dec688844f 100644 --- a/toolchain/check/testdata/impl/lookup/canonical_query_self.carbon +++ b/toolchain/check/testdata/impl/lookup/canonical_query_self.carbon @@ -400,7 +400,7 @@ fn G() { // CHECK:STDOUT: %JJ.ref: %J.assoc_type = name_ref JJ, @J.WithSelf.%assoc0 [concrete = constants.%assoc0.8f4] // CHECK:STDOUT: %impl.elem0: %.366 = impl_witness_access constants.%J.impl_witness, element0 [concrete = constants.%C.as.J.impl.JJ] // CHECK:STDOUT: %bound_method: = bound_method %.loc40_8.2, %impl.elem0 [concrete = constants.%C.as.J.impl.JJ.bound] -// CHECK:STDOUT: %.loc40_8.3: %C = acquire_value %.loc40_8.2 +// CHECK:STDOUT: %.loc40_8.3: %C = acquire_value %.loc40_8.2 [concrete = constants.%C.val] // CHECK:STDOUT: %C.as.J.impl.JJ.call: init %empty_tuple.type = call %bound_method(%.loc40_8.3) // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] // CHECK:STDOUT: %C.ref.loc46_5: type = name_ref C, %C.decl [concrete = constants.%C] @@ -415,7 +415,7 @@ fn G() { // CHECK:STDOUT: %.loc46_15.2: %facet_type = converted constants.%C, %facet_value.loc46_15.2 [concrete = constants.%facet_value] // CHECK:STDOUT: %F.specific_fn: = specific_function %F.ref, @F(constants.%facet_value) [concrete = constants.%F.specific_fn] // CHECK:STDOUT: %.loc46_11.2: ref %C = temporary %.loc46_9.2, %.loc46_11.1 [concrete = constants.%.b19] -// CHECK:STDOUT: %.loc46_11.3: %C = acquire_value %.loc46_11.2 +// CHECK:STDOUT: %.loc46_11.3: %C = acquire_value %.loc46_11.2 [concrete = constants.%C.val] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn(%.loc46_11.3) // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/use_assoc_entity.carbon b/toolchain/check/testdata/impl/use_assoc_entity.carbon index 1103738171f5..9ad1c8ca9bc0 100644 --- a/toolchain/check/testdata/impl/use_assoc_entity.carbon +++ b/toolchain/check/testdata/impl/use_assoc_entity.carbon @@ -4722,7 +4722,7 @@ fn F() { // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%Z.impl_witness.63b, element0 [concrete = constants.%C.302] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc12_30.2: ref %C.302 = temporary %.loc12_28.2, %.loc12_30.1 [concrete = constants.%.cdd] -// CHECK:STDOUT: %.loc12_30.3: %C.302 = acquire_value %.loc12_30.2 +// CHECK:STDOUT: %.loc12_30.3: %C.302 = acquire_value %.loc12_30.2 [concrete = constants.%C.val] // CHECK:STDOUT: %a: %C.302 = value_binding a, %.loc12_30.3 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/generic_method.carbon b/toolchain/check/testdata/interface/generic_method.carbon index 778132b1d784..3aa2d598d95b 100644 --- a/toolchain/check/testdata/interface/generic_method.carbon +++ b/toolchain/check/testdata/interface/generic_method.carbon @@ -1157,7 +1157,7 @@ fn CallIndirect() { // CHECK:STDOUT: %.loc24_38.3: init %Z to %.loc24_38.2 = class_init () [concrete = constants.%Z.val] // CHECK:STDOUT: %.loc24_38.4: init %Z = converted %.loc24_38.1, %.loc24_38.3 [concrete = constants.%Z.val] // CHECK:STDOUT: %.loc24_38.5: ref %Z = temporary %.loc24_38.2, %.loc24_38.4 [concrete = constants.%.318] -// CHECK:STDOUT: %.loc24_38.6: %Z = acquire_value %.loc24_38.5 +// CHECK:STDOUT: %.loc24_38.6: %Z = acquire_value %.loc24_38.5 [concrete = constants.%Z.val] // CHECK:STDOUT: %tuple.type.as.A.impl.F.call: init %tuple.type.65a to %.loc24_39.1 = call %specific_fn(%.loc24_38.6) // CHECK:STDOUT: %.loc24_39.2: ref %tuple.type.65a = temporary %.loc24_39.1, %tuple.type.as.A.impl.F.call // CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc24_39.2, constants.%Destroy.Op.651ba6.1 @@ -1204,7 +1204,7 @@ fn CallIndirect() { // CHECK:STDOUT: %.loc28_11.3: init %Z to %.loc28_11.2 = class_init () [concrete = constants.%Z.val] // CHECK:STDOUT: %.loc28_11.4: init %Z = converted %.loc28_11.1, %.loc28_11.3 [concrete = constants.%Z.val] // CHECK:STDOUT: %.loc28_11.5: ref %Z = temporary %.loc28_11.2, %.loc28_11.4 [concrete = constants.%.318] -// CHECK:STDOUT: %.loc28_11.6: %Z = acquire_value %.loc28_11.5 +// CHECK:STDOUT: %.loc28_11.6: %Z = acquire_value %.loc28_11.5 [concrete = constants.%Z.val] // CHECK:STDOUT: %A.WithSelf.F.call: init @CallGeneric.%tuple.type (%tuple.type.856) to %.loc28_12.1 = call %specific_impl_fn.loc28_4.1(%.loc28_11.6) // CHECK:STDOUT: %.loc28_12.2: ref @CallGeneric.%tuple.type (%tuple.type.856) = temporary %.loc28_12.1, %A.WithSelf.F.call // CHECK:STDOUT: %impl.elem0.loc28_12.1: @CallGeneric.%.loc28_12.3 (%.949) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc28_12.2 (constants.%impl.elem0.487)] diff --git a/toolchain/check/testdata/interop/cpp/function/default_arg.carbon b/toolchain/check/testdata/interop/cpp/function/default_arg.carbon index b8d64f2cdbc0..a4629bf0cbef 100644 --- a/toolchain/check/testdata/interop/cpp/function/default_arg.carbon +++ b/toolchain/check/testdata/interop/cpp/function/default_arg.carbon @@ -391,7 +391,7 @@ fn Call() { // CHECK:STDOUT: %bound_method.loc12_16: = bound_method %.loc12_7.2, %D.ref [concrete = constants.%bound_method.d5c] // CHECK:STDOUT: %int_1.loc12: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %int_2.loc12: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] -// CHECK:STDOUT: %.loc12_7.3: %X = acquire_value %.loc12_7.2 +// CHECK:STDOUT: %.loc12_7.3: %X = acquire_value %.loc12_7.2 [concrete = constants.%X.val] // CHECK:STDOUT: %impl.elem0.loc12_19: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] // CHECK:STDOUT: %bound_method.loc12_19.1: = bound_method %int_1.loc12, %impl.elem0.loc12_19 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215] // CHECK:STDOUT: %specific_fn.loc12_19: = specific_function %impl.elem0.loc12_19, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -787,7 +787,7 @@ fn Call() { // CHECK:STDOUT: %D.ref: %X.D.cpp_overload_set.type = name_ref D, imports.%X.D.cpp_overload_set.value [concrete = constants.%X.D.cpp_overload_set.value] // CHECK:STDOUT: %bound_method.loc13_16: = bound_method %.loc13_7.2, %D.ref [concrete = constants.%bound_method.d5c] // CHECK:STDOUT: %int_1.loc13: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %.loc13_7.3: %X = acquire_value %.loc13_7.2 +// CHECK:STDOUT: %.loc13_7.3: %X = acquire_value %.loc13_7.2 [concrete = constants.%X.val] // CHECK:STDOUT: %impl.elem0.loc13: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] // CHECK:STDOUT: %bound_method.loc13_19.1: = bound_method %int_1.loc13, %impl.elem0.loc13 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215] // CHECK:STDOUT: %specific_fn.loc13: = specific_function %impl.elem0.loc13, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] diff --git a/toolchain/check/testdata/interop/cpp/function/overloads.carbon b/toolchain/check/testdata/interop/cpp/function/overloads.carbon index 27c04850fe4e..8abef67a6d26 100644 --- a/toolchain/check/testdata/interop/cpp/function/overloads.carbon +++ b/toolchain/check/testdata/interop/cpp/function/overloads.carbon @@ -2448,7 +2448,7 @@ fn F() { // CHECK:STDOUT: %.loc9_21.3: init %NoFields to %.loc9_21.2 = class_init () [concrete = constants.%NoFields.val] // CHECK:STDOUT: %.loc9_21.4: init %NoFields = converted %.loc9_21.1, %.loc9_21.3 [concrete = constants.%NoFields.val] // CHECK:STDOUT: %.loc9_21.5: ref %NoFields = temporary %.loc9_21.2, %.loc9_21.4 [concrete = constants.%.413] -// CHECK:STDOUT: %.loc9_21.6: %NoFields = acquire_value %.loc9_21.5 +// CHECK:STDOUT: %.loc9_21.6: %NoFields = acquire_value %.loc9_21.5 [concrete = constants.%NoFields.val] // CHECK:STDOUT: %.loc9_21.7: ref %NoFields = value_as_ref %.loc9_21.6 // CHECK:STDOUT: %addr.loc9: %ptr.dd0 = addr_of %.loc9_21.7 // CHECK:STDOUT: %PassNoFields__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%PassNoFields__carbon_thunk.decl(%addr.loc9) @@ -2459,7 +2459,7 @@ fn F() { // CHECK:STDOUT: %.loc11_20.2: init %NoFields to %.loc11_20.1 = class_init () [concrete = constants.%NoFields.val] // CHECK:STDOUT: %.loc11_20.3: init %NoFields = converted %value.ref, %.loc11_20.2 [concrete = constants.%NoFields.val] // CHECK:STDOUT: %.loc11_20.4: ref %NoFields = temporary %.loc11_20.1, %.loc11_20.3 [concrete = constants.%.413] -// CHECK:STDOUT: %.loc11_20.5: %NoFields = acquire_value %.loc11_20.4 +// CHECK:STDOUT: %.loc11_20.5: %NoFields = acquire_value %.loc11_20.4 [concrete = constants.%NoFields.val] // CHECK:STDOUT: %.loc11_20.6: ref %NoFields = value_as_ref %.loc11_20.5 // CHECK:STDOUT: %addr.loc11: %ptr.dd0 = addr_of %.loc11_20.6 // CHECK:STDOUT: %PassNoFields__carbon_thunk.call.loc11: init %empty_tuple.type = call imports.%PassNoFields__carbon_thunk.decl(%addr.loc11) @@ -2470,7 +2470,7 @@ fn F() { // CHECK:STDOUT: %.loc13_20.2: init %NoFields to %.loc13_20.1 = class_init () [concrete = constants.%NoFields.val] // CHECK:STDOUT: %.loc13_20.3: init %NoFields = converted %reference.ref, %.loc13_20.2 [concrete = constants.%NoFields.val] // CHECK:STDOUT: %.loc13_20.4: ref %NoFields = temporary %.loc13_20.1, %.loc13_20.3 [concrete = constants.%.413] -// CHECK:STDOUT: %.loc13_20.5: %NoFields = acquire_value %.loc13_20.4 +// CHECK:STDOUT: %.loc13_20.5: %NoFields = acquire_value %.loc13_20.4 [concrete = constants.%NoFields.val] // CHECK:STDOUT: %.loc13_20.6: ref %NoFields = value_as_ref %.loc13_20.5 // CHECK:STDOUT: %addr.loc13: %ptr.dd0 = addr_of %.loc13_20.6 // CHECK:STDOUT: %PassNoFields__carbon_thunk.call.loc13: init %empty_tuple.type = call imports.%PassNoFields__carbon_thunk.decl(%addr.loc13) @@ -2484,7 +2484,7 @@ fn F() { // CHECK:STDOUT: %.loc15_30.4: init %NoFields to %.loc15_30.3 = class_init () [concrete = constants.%NoFields.val] // CHECK:STDOUT: %.loc15_30.5: init %NoFields = converted %MakeEmpty.call, %.loc15_30.4 [concrete = constants.%NoFields.val] // CHECK:STDOUT: %.loc15_30.6: ref %NoFields = temporary %.loc15_30.3, %.loc15_30.5 [concrete = constants.%.413] -// CHECK:STDOUT: %.loc15_30.7: %NoFields = acquire_value %.loc15_30.6 +// CHECK:STDOUT: %.loc15_30.7: %NoFields = acquire_value %.loc15_30.6 [concrete = constants.%NoFields.val] // CHECK:STDOUT: %.loc15_30.8: ref %NoFields = value_as_ref %.loc15_30.7 // CHECK:STDOUT: %addr.loc15: %ptr.dd0 = addr_of %.loc15_30.8 // CHECK:STDOUT: %PassNoFields__carbon_thunk.call.loc15: init %empty_tuple.type = call imports.%PassNoFields__carbon_thunk.decl(%addr.loc15) diff --git a/toolchain/check/testdata/interop/cpp/function/pointer.carbon b/toolchain/check/testdata/interop/cpp/function/pointer.carbon index 4108427456dc..f7f70c84c4c4 100644 --- a/toolchain/check/testdata/interop/cpp/function/pointer.carbon +++ b/toolchain/check/testdata/interop/cpp/function/pointer.carbon @@ -1929,7 +1929,7 @@ fn F() { // CHECK:STDOUT: %.loc13_55.3: init %S to %.loc13_55.2 = class_init () [concrete = constants.%S.val] // CHECK:STDOUT: %.loc13_57.1: init %S = converted %.loc13_55.1, %.loc13_55.3 [concrete = constants.%S.val] // CHECK:STDOUT: %.loc13_57.2: ref %S = temporary %.loc13_55.2, %.loc13_57.1 [concrete = constants.%.6ef] -// CHECK:STDOUT: %.loc13_57.3: %S = acquire_value %.loc13_57.2 +// CHECK:STDOUT: %.loc13_57.3: %S = acquire_value %.loc13_57.2 [concrete = constants.%S.val] // CHECK:STDOUT: %.loc13_57.4: ref %S = value_as_ref %.loc13_57.3 // CHECK:STDOUT: %addr.loc13: %ptr.5c7 = addr_of %.loc13_57.4 // CHECK:STDOUT: %Indirect__carbon_thunk.call: init %Optional.065 = call imports.%Indirect__carbon_thunk.decl(%addr.loc13) diff --git a/toolchain/check/testdata/interop/cpp/function/reference.carbon b/toolchain/check/testdata/interop/cpp/function/reference.carbon index 85884e40a725..fe278b5a890e 100644 --- a/toolchain/check/testdata/interop/cpp/function/reference.carbon +++ b/toolchain/check/testdata/interop/cpp/function/reference.carbon @@ -561,7 +561,7 @@ fn F() { // CHECK:STDOUT: %.loc8_20.3: init %S to %.loc8_20.2 = class_init () [concrete = constants.%S.val] // CHECK:STDOUT: %.loc8_22.1: init %S = converted %.loc8_20.1, %.loc8_20.3 [concrete = constants.%S.val] // CHECK:STDOUT: %.loc8_22.2: ref %S = temporary %.loc8_20.2, %.loc8_22.1 [concrete = constants.%.6ef] -// CHECK:STDOUT: %.loc8_22.3: %S = acquire_value %.loc8_22.2 +// CHECK:STDOUT: %.loc8_22.3: %S = acquire_value %.loc8_22.2 [concrete = constants.%S.val] // CHECK:STDOUT: %.loc8_22.4: ref %S = value_as_ref %.loc8_22.3 // CHECK:STDOUT: %addr: %ptr.5c7 = addr_of %.loc8_22.4 // CHECK:STDOUT: %TakesRValue__carbon_thunk.call: init %empty_tuple.type = call imports.%TakesRValue__carbon_thunk.decl(%addr) @@ -813,7 +813,7 @@ fn F() { // CHECK:STDOUT: %.loc8_19.3: init %S to %.loc8_19.2 = class_init () [concrete = constants.%S.val] // CHECK:STDOUT: %.loc8_19.4: init %S = converted %.loc8_19.1, %.loc8_19.3 [concrete = constants.%S.val] // CHECK:STDOUT: %.loc8_19.5: ref %S = temporary %.loc8_19.2, %.loc8_19.4 [concrete = constants.%.6ef] -// CHECK:STDOUT: %.loc8_19.6: %S = acquire_value %.loc8_19.5 +// CHECK:STDOUT: %.loc8_19.6: %S = acquire_value %.loc8_19.5 [concrete = constants.%S.val] // CHECK:STDOUT: %s: %S = value_binding s, %.loc8_19.6 // CHECK:STDOUT: %Cpp.ref.loc9: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %TakesConstLValue.ref.loc9: %TakesConstLValue.cpp_overload_set.type = name_ref TakesConstLValue, imports.%TakesConstLValue.cpp_overload_set.value [concrete = constants.%TakesConstLValue.cpp_overload_set.value] diff --git a/toolchain/check/testdata/interop/cpp/stdlib/initializer_list.carbon b/toolchain/check/testdata/interop/cpp/stdlib/initializer_list.carbon index 4ca7aae50333..78328affc2f6 100644 --- a/toolchain/check/testdata/interop/cpp/stdlib/initializer_list.carbon +++ b/toolchain/check/testdata/interop/cpp/stdlib/initializer_list.carbon @@ -230,7 +230,7 @@ fn F() { // CHECK:STDOUT: %.loc8_50.13: init %array_type to %.loc8_50.4 = array_init (%.loc8_50.6, %.loc8_50.9, %.loc8_50.12) [concrete = constants.%array] // CHECK:STDOUT: %.loc8_50.14: init %array_type = converted %.loc8_50.1, %.loc8_50.13 [concrete = constants.%array] // CHECK:STDOUT: %.loc8_50.15: ref %array_type = temporary %.loc8_50.4, %.loc8_50.14 [concrete = constants.%.fd3] -// CHECK:STDOUT: %.loc8_50.16: %array_type = acquire_value %.loc8_50.15 +// CHECK:STDOUT: %.loc8_50.16: %array_type = acquire_value %.loc8_50.15 [concrete = constants.%array] // CHECK:STDOUT: %initializer_list.initializer_list.call.loc8: init %initializer_list to %.loc8_50.2 = call generated.%initializer_list.initializer_list.decl.2bdc3e.1(%.loc8_50.16) // CHECK:STDOUT: %.loc8_50.17: init %initializer_list = converted %.loc8_50.1, %initializer_list.initializer_list.call.loc8 // CHECK:STDOUT: %.loc8_50.18: ref %initializer_list = temporary %.loc8_50.2, %.loc8_50.17 @@ -277,7 +277,7 @@ fn F() { // CHECK:STDOUT: %.loc10_23.13: init %array_type to %.loc10_23.4 = array_init (%.loc10_23.6, %.loc10_23.9, %.loc10_23.12) [concrete = constants.%array] // CHECK:STDOUT: %.loc10_23.14: init %array_type = converted %.loc10_23.1, %.loc10_23.13 [concrete = constants.%array] // CHECK:STDOUT: %.loc10_23.15: ref %array_type = temporary %.loc10_23.4, %.loc10_23.14 [concrete = constants.%.fd3] -// CHECK:STDOUT: %.loc10_23.16: %array_type = acquire_value %.loc10_23.15 +// CHECK:STDOUT: %.loc10_23.16: %array_type = acquire_value %.loc10_23.15 [concrete = constants.%array] // CHECK:STDOUT: %initializer_list.initializer_list.call.loc10: init %initializer_list to %.loc10_23.2 = call generated.%initializer_list.initializer_list.decl.2bdc3e.2(%.loc10_23.16) // CHECK:STDOUT: %.loc10_23.17: init %initializer_list = converted %.loc10_23.1, %initializer_list.initializer_list.call.loc10 // CHECK:STDOUT: %.loc10_23.18: ref %initializer_list = temporary %.loc10_23.2, %.loc10_23.17 @@ -332,7 +332,7 @@ fn F() { // CHECK:STDOUT: %.loc12_44.14: init %array_type to %.loc12_44.5 = array_init (%.loc12_44.7, %.loc12_44.10, %.loc12_44.13) [concrete = constants.%array] // CHECK:STDOUT: %.loc12_44.15: init %array_type = converted %.loc12_44.1, %.loc12_44.14 [concrete = constants.%array] // CHECK:STDOUT: %.loc12_44.16: ref %array_type = temporary %.loc12_44.5, %.loc12_44.15 [concrete = constants.%.fd3] -// CHECK:STDOUT: %.loc12_44.17: %array_type = acquire_value %.loc12_44.16 +// CHECK:STDOUT: %.loc12_44.17: %array_type = acquire_value %.loc12_44.16 [concrete = constants.%array] // CHECK:STDOUT: %initializer_list.initializer_list.call.loc12: init %initializer_list to %.loc12_44.3 = call generated.%initializer_list.initializer_list.decl.2bdc3e.3(%.loc12_44.17) // CHECK:STDOUT: %.loc12_44.18: init %initializer_list = converted %.loc12_44.1, %initializer_list.initializer_list.call.loc12 // CHECK:STDOUT: %.loc12_44.19: ref %initializer_list = temporary %.loc12_44.3, %.loc12_44.18 diff --git a/toolchain/check/testdata/interop/cpp/template/class_template.carbon b/toolchain/check/testdata/interop/cpp/template/class_template.carbon index e8df99399461..6271b7608db0 100644 --- a/toolchain/check/testdata/interop/cpp/template/class_template.carbon +++ b/toolchain/check/testdata/interop/cpp/template/class_template.carbon @@ -99,7 +99,7 @@ var a: Cpp.A = Cpp.X(Cpp.A, Cpp.B).f({} as Cpp.B); // CHECK:STDOUT: %.loc7_41.1: init %B = converted %.loc7_39.1, %.loc7_39.3 [concrete = constants.%B.val] // CHECK:STDOUT: %.loc7_1: ref %A = splice_block file.%a.var [concrete = file.%a.var] {} // CHECK:STDOUT: %.loc7_41.2: ref %B = temporary %.loc7_39.2, %.loc7_41.1 [concrete = constants.%.5ef] -// CHECK:STDOUT: %.loc7_41.3: %B = acquire_value %.loc7_41.2 +// CHECK:STDOUT: %.loc7_41.3: %B = acquire_value %.loc7_41.2 [concrete = constants.%B.val] // CHECK:STDOUT: %.loc7_41.4: ref %B = value_as_ref %.loc7_41.3 // CHECK:STDOUT: %addr.loc7_49.1: %ptr.a04 = addr_of %.loc7_41.4 // CHECK:STDOUT: %addr.loc7_49.2: %ptr.270 = addr_of %.loc7_1 diff --git a/toolchain/check/testdata/operators/overloaded/index.carbon b/toolchain/check/testdata/operators/overloaded/index.carbon index 1467c28c1a36..01eb4a74e7b8 100644 --- a/toolchain/check/testdata/operators/overloaded/index.carbon +++ b/toolchain/check/testdata/operators/overloaded/index.carbon @@ -484,7 +484,7 @@ fn F() { // CHECK:STDOUT: %.loc15_15.3: init %C to %.loc15_15.2 = class_init () [concrete = constants.%C.val] // CHECK:STDOUT: %.loc15_15.4: init %C = converted %.loc15_15.1, %.loc15_15.3 [concrete = constants.%C.val] // CHECK:STDOUT: %.loc15_15.5: ref %C = temporary %.loc15_15.2, %.loc15_15.4 [concrete = constants.%.5ea] -// CHECK:STDOUT: %.loc15_15.6: %C = acquire_value %.loc15_15.5 +// CHECK:STDOUT: %.loc15_15.6: %C = acquire_value %.loc15_15.5 [concrete = constants.%C.val] // CHECK:STDOUT: %c: %C = value_binding c, %.loc15_15.6 // CHECK:STDOUT: %c.ref: %C = name_ref c, %c // CHECK:STDOUT: %.loc23: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] diff --git a/toolchain/check/testdata/operators/overloaded/index_with_prelude.carbon b/toolchain/check/testdata/operators/overloaded/index_with_prelude.carbon index 746b501e92ec..abf187f9bf3d 100644 --- a/toolchain/check/testdata/operators/overloaded/index_with_prelude.carbon +++ b/toolchain/check/testdata/operators/overloaded/index_with_prelude.carbon @@ -175,7 +175,7 @@ let x: i32 = c[0]; // CHECK:STDOUT: %.loc14_25.2: init %SubscriptType.9ec to %.loc14_25.1 = class_init () [concrete = constants.%SubscriptType.val] // CHECK:STDOUT: %.loc14_25.3: init %SubscriptType.9ec = converted @__global_init.%.loc14, %.loc14_25.2 [concrete = constants.%SubscriptType.val] // CHECK:STDOUT: %.loc14_25.4: ref %SubscriptType.9ec = temporary %.loc14_25.1, %.loc14_25.3 [concrete = constants.%.e36] -// CHECK:STDOUT: %.loc14_25.5: %SubscriptType.9ec = acquire_value %.loc14_25.4 +// CHECK:STDOUT: %.loc14_25.5: %SubscriptType.9ec = acquire_value %.loc14_25.4 [concrete = constants.%SubscriptType.val] // CHECK:STDOUT: %s: %SubscriptType.9ec = value_binding s, %.loc14_25.5 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %c.patt: %pattern_type.7c7 = value_binding_pattern c [concrete] @@ -185,7 +185,7 @@ let x: i32 = c[0]; // CHECK:STDOUT: %.loc15_13.2: init %C to %.loc15_13.1 = class_init () [concrete = constants.%C.val] // CHECK:STDOUT: %.loc15_13.3: init %C = converted @__global_init.%.loc15, %.loc15_13.2 [concrete = constants.%C.val] // CHECK:STDOUT: %.loc15_13.4: ref %C = temporary %.loc15_13.1, %.loc15_13.3 [concrete = constants.%.5ea] -// CHECK:STDOUT: %.loc15_13.5: %C = acquire_value %.loc15_13.4 +// CHECK:STDOUT: %.loc15_13.5: %C = acquire_value %.loc15_13.4 [concrete = constants.%C.val] // CHECK:STDOUT: %c: %C = value_binding c, %.loc15_13.5 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %x.patt: %pattern_type.fde = value_binding_pattern x [concrete] @@ -555,7 +555,7 @@ let x: i32 = c[0]; // CHECK:STDOUT: %.loc14_13.2: init %C to %.loc14_13.1 = class_init () [concrete = constants.%C.val] // CHECK:STDOUT: %.loc14_13.3: init %C = converted @__global_init.%.loc14, %.loc14_13.2 [concrete = constants.%C.val] // CHECK:STDOUT: %.loc14_13.4: ref %C = temporary %.loc14_13.1, %.loc14_13.3 [concrete = constants.%.5ea] -// CHECK:STDOUT: %.loc14_13.5: %C = acquire_value %.loc14_13.4 +// CHECK:STDOUT: %.loc14_13.5: %C = acquire_value %.loc14_13.4 [concrete = constants.%C.val] // CHECK:STDOUT: %c: %C = value_binding c, %.loc14_13.5 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %x.patt: %pattern_type.fde = value_binding_pattern x [concrete] @@ -683,7 +683,7 @@ let x: i32 = c[0]; // CHECK:STDOUT: %.loc6_13.2: init %C to %.loc6_13.1 = class_init () [concrete = constants.%C.val] // CHECK:STDOUT: %.loc6_13.3: init %C = converted @__global_init.%.loc6, %.loc6_13.2 [concrete = constants.%C.val] // CHECK:STDOUT: %.loc6_13.4: ref %C = temporary %.loc6_13.1, %.loc6_13.3 [concrete = constants.%.5ea] -// CHECK:STDOUT: %.loc6_13.5: %C = acquire_value %.loc6_13.4 +// CHECK:STDOUT: %.loc6_13.5: %C = acquire_value %.loc6_13.4 [concrete = constants.%C.val] // CHECK:STDOUT: %c: %C = value_binding c, %.loc6_13.5 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %x.patt: %pattern_type.7ce = value_binding_pattern x [concrete] diff --git a/toolchain/check/testdata/packages/missing_prelude.carbon b/toolchain/check/testdata/packages/missing_prelude.carbon index 720c64b16a0c..562561d1647f 100644 --- a/toolchain/check/testdata/packages/missing_prelude.carbon +++ b/toolchain/check/testdata/packages/missing_prelude.carbon @@ -609,7 +609,7 @@ let n: type = i32; // CHECK:STDOUT: %.loc8_15.2: init %Int.553 to %.loc8_15.1 = class_init () [concrete = constants.%Int.val] // CHECK:STDOUT: %.loc8_15.3: init %Int.553 = converted @__global_init.%.loc8, %.loc8_15.2 [concrete = constants.%Int.val] // CHECK:STDOUT: %.loc8_15.4: ref %Int.553 = temporary %.loc8_15.1, %.loc8_15.3 [concrete = constants.%.fdf] -// CHECK:STDOUT: %.loc8_15.5: %Int.553 = acquire_value %.loc8_15.4 +// CHECK:STDOUT: %.loc8_15.5: %Int.553 = acquire_value %.loc8_15.4 [concrete = constants.%Int.val] // CHECK:STDOUT: %n: %Int.553 = value_binding n, %.loc8_15.5 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/import_convert_function.carbon b/toolchain/check/testdata/return/import_convert_function.carbon index cf082933deb1..f9a922f6cdf8 100644 --- a/toolchain/check/testdata/return/import_convert_function.carbon +++ b/toolchain/check/testdata/return/import_convert_function.carbon @@ -1038,7 +1038,7 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %bound_method.loc7_35: = bound_method %.loc7_26.1, %impl.elem0.loc7_35 [concrete = constants.%C.as.ImplicitAs.impl.Convert.bound.cfc] // CHECK:STDOUT: %.loc6_26.1: ref %D = splice_block %return.param {} // CHECK:STDOUT: %.loc7_26.2: ref %C.b00 = temporary %.loc7_24.2, %.loc7_26.1 [concrete = constants.%.b4e] -// CHECK:STDOUT: %.loc7_26.3: %C.b00 = acquire_value %.loc7_26.2 +// CHECK:STDOUT: %.loc7_26.3: %C.b00 = acquire_value %.loc7_26.2 [concrete = constants.%C.val.452] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc7: init %D to %.loc6_26.1 = call %bound_method.loc7_35(%.loc7_26.3) // CHECK:STDOUT: %.loc7_35: init %D = converted %.loc7_26.1, %C.as.ImplicitAs.impl.Convert.call.loc7 // CHECK:STDOUT: return %.loc7_35 to %return.param @@ -1067,7 +1067,7 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %bound_method.loc8_35: = bound_method %.loc8_26.1, %impl.elem0.loc8_35 [concrete = constants.%C.as.ImplicitAs.impl.Convert.bound.530] // CHECK:STDOUT: %.loc6_26.2: ref %D = splice_block %return.param {} // CHECK:STDOUT: %.loc8_26.2: ref %C.674 = temporary %.loc8_24.2, %.loc8_26.1 [concrete = constants.%.6f4] -// CHECK:STDOUT: %.loc8_26.3: %C.674 = acquire_value %.loc8_26.2 +// CHECK:STDOUT: %.loc8_26.3: %C.674 = acquire_value %.loc8_26.2 [concrete = constants.%C.val.678] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc8: init %D to %.loc6_26.2 = call %bound_method.loc8_35(%.loc8_26.3) // CHECK:STDOUT: %.loc8_35: init %D = converted %.loc8_26.1, %C.as.ImplicitAs.impl.Convert.call.loc8 // CHECK:STDOUT: return %.loc8_35 to %return.param @@ -1096,7 +1096,7 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %bound_method.loc9_35: = bound_method %.loc9_26.1, %impl.elem0.loc9_35 [concrete = constants.%C.as.ImplicitAs.impl.Convert.bound.fc6] // CHECK:STDOUT: %.loc6_26.3: ref %D = splice_block %return.param {} // CHECK:STDOUT: %.loc9_26.2: ref %C.681 = temporary %.loc9_24.2, %.loc9_26.1 [concrete = constants.%.18a] -// CHECK:STDOUT: %.loc9_26.3: %C.681 = acquire_value %.loc9_26.2 +// CHECK:STDOUT: %.loc9_26.3: %C.681 = acquire_value %.loc9_26.2 [concrete = constants.%C.val.fb5] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc9: init %D to %.loc6_26.3 = call %bound_method.loc9_35(%.loc9_26.3) // CHECK:STDOUT: %.loc9_35: init %D = converted %.loc9_26.1, %C.as.ImplicitAs.impl.Convert.call.loc9 // CHECK:STDOUT: return %.loc9_35 to %return.param @@ -1125,7 +1125,7 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %bound_method.loc10_35: = bound_method %.loc10_26.1, %impl.elem0.loc10_35 [concrete = constants.%C.as.ImplicitAs.impl.Convert.bound.ffe] // CHECK:STDOUT: %.loc6_26.4: ref %D = splice_block %return.param {} // CHECK:STDOUT: %.loc10_26.2: ref %C.7ac = temporary %.loc10_24.2, %.loc10_26.1 [concrete = constants.%.440] -// CHECK:STDOUT: %.loc10_26.3: %C.7ac = acquire_value %.loc10_26.2 +// CHECK:STDOUT: %.loc10_26.3: %C.7ac = acquire_value %.loc10_26.2 [concrete = constants.%C.val.fe7] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc10: init %D to %.loc6_26.4 = call %bound_method.loc10_35(%.loc10_26.3) // CHECK:STDOUT: %.loc10_35: init %D = converted %.loc10_26.1, %C.as.ImplicitAs.impl.Convert.call.loc10 // CHECK:STDOUT: return %.loc10_35 to %return.param @@ -1154,7 +1154,7 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %bound_method.loc11_35: = bound_method %.loc11_26.1, %impl.elem0.loc11_35 [concrete = constants.%C.as.ImplicitAs.impl.Convert.bound.7cc] // CHECK:STDOUT: %.loc6_26.5: ref %D = splice_block %return.param {} // CHECK:STDOUT: %.loc11_26.2: ref %C.89d = temporary %.loc11_24.2, %.loc11_26.1 [concrete = constants.%.c3b] -// CHECK:STDOUT: %.loc11_26.3: %C.89d = acquire_value %.loc11_26.2 +// CHECK:STDOUT: %.loc11_26.3: %C.89d = acquire_value %.loc11_26.2 [concrete = constants.%C.val.1dd] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc11: init %D to %.loc6_26.5 = call %bound_method.loc11_35(%.loc11_26.3) // CHECK:STDOUT: %.loc11_35: init %D = converted %.loc11_26.1, %C.as.ImplicitAs.impl.Convert.call.loc11 // CHECK:STDOUT: return %.loc11_35 to %return.param @@ -1183,7 +1183,7 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %bound_method.loc12_35: = bound_method %.loc12_26.1, %impl.elem0.loc12_35 [concrete = constants.%C.as.ImplicitAs.impl.Convert.bound.4ca] // CHECK:STDOUT: %.loc6_26.6: ref %D = splice_block %return.param {} // CHECK:STDOUT: %.loc12_26.2: ref %C.f0a = temporary %.loc12_24.2, %.loc12_26.1 [concrete = constants.%.d3c] -// CHECK:STDOUT: %.loc12_26.3: %C.f0a = acquire_value %.loc12_26.2 +// CHECK:STDOUT: %.loc12_26.3: %C.f0a = acquire_value %.loc12_26.2 [concrete = constants.%C.val.a4a] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc12: init %D to %.loc6_26.6 = call %bound_method.loc12_35(%.loc12_26.3) // CHECK:STDOUT: %.loc12_35: init %D = converted %.loc12_26.1, %C.as.ImplicitAs.impl.Convert.call.loc12 // CHECK:STDOUT: return %.loc12_35 to %return.param @@ -1212,7 +1212,7 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %bound_method.loc13_35: = bound_method %.loc13_26.1, %impl.elem0.loc13_35 [concrete = constants.%C.as.ImplicitAs.impl.Convert.bound.f82] // CHECK:STDOUT: %.loc6_26.7: ref %D = splice_block %return.param {} // CHECK:STDOUT: %.loc13_26.2: ref %C.c60 = temporary %.loc13_24.2, %.loc13_26.1 [concrete = constants.%.d2b] -// CHECK:STDOUT: %.loc13_26.3: %C.c60 = acquire_value %.loc13_26.2 +// CHECK:STDOUT: %.loc13_26.3: %C.c60 = acquire_value %.loc13_26.2 [concrete = constants.%C.val.a4b] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc13: init %D to %.loc6_26.7 = call %bound_method.loc13_35(%.loc13_26.3) // CHECK:STDOUT: %.loc13_35: init %D = converted %.loc13_26.1, %C.as.ImplicitAs.impl.Convert.call.loc13 // CHECK:STDOUT: return %.loc13_35 to %return.param @@ -1241,7 +1241,7 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %bound_method.loc14_35: = bound_method %.loc14_26.1, %impl.elem0.loc14_35 [concrete = constants.%C.as.ImplicitAs.impl.Convert.bound.622] // CHECK:STDOUT: %.loc6_26.8: ref %D = splice_block %return.param {} // CHECK:STDOUT: %.loc14_26.2: ref %C.304 = temporary %.loc14_24.2, %.loc14_26.1 [concrete = constants.%.5dc] -// CHECK:STDOUT: %.loc14_26.3: %C.304 = acquire_value %.loc14_26.2 +// CHECK:STDOUT: %.loc14_26.3: %C.304 = acquire_value %.loc14_26.2 [concrete = constants.%C.val.f9f] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc14: init %D to %.loc6_26.8 = call %bound_method.loc14_35(%.loc14_26.3) // CHECK:STDOUT: %.loc14_35: init %D = converted %.loc14_26.1, %C.as.ImplicitAs.impl.Convert.call.loc14 // CHECK:STDOUT: return %.loc14_35 to %return.param diff --git a/toolchain/lower/testdata/array/function_param.carbon b/toolchain/lower/testdata/array/function_param.carbon index 84064bb90dbf..06c0203e42a0 100644 --- a/toolchain/lower/testdata/array/function_param.carbon +++ b/toolchain/lower/testdata/array/function_param.carbon @@ -22,6 +22,7 @@ fn G() -> i32 { // CHECK:STDOUT: source_filename = "function_param.carbon" // CHECK:STDOUT: // CHECK:STDOUT: @array = internal constant [3 x i32] [i32 1, i32 2, i32 3] +// CHECK:STDOUT: @array.loc18_20.15 = internal constant [3 x i32] [i32 1, i32 2, i32 3] // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind // CHECK:STDOUT: define i32 @_CF.Main(ptr %arr, i32 %i) #0 !dbg !4 { @@ -39,7 +40,7 @@ fn G() -> i32 { // CHECK:STDOUT: %.loc18_20.4.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_20.3.temp, i32 0, i64 0, !dbg !17 // CHECK:STDOUT: %.loc18_20.7.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_20.3.temp, i32 0, i64 1, !dbg !17 // CHECK:STDOUT: %.loc18_20.10.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_20.3.temp, i32 0, i64 2, !dbg !17 -// CHECK:STDOUT: %F.call = call i32 @_CF.Main(ptr @array, i32 1), !dbg !18 +// CHECK:STDOUT: %F.call = call i32 @_CF.Main(ptr @array.loc18_20.15, i32 1), !dbg !18 // CHECK:STDOUT: ret i32 %F.call, !dbg !19 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/array/iterate.carbon b/toolchain/lower/testdata/array/iterate.carbon index 8c2b19945be4..3d52228c4030 100644 --- a/toolchain/lower/testdata/array/iterate.carbon +++ b/toolchain/lower/testdata/array/iterate.carbon @@ -23,6 +23,7 @@ fn F() { // CHECK:STDOUT: source_filename = "iterate.carbon" // CHECK:STDOUT: // CHECK:STDOUT: @array = internal constant [6 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6] +// CHECK:STDOUT: @array.loc16_43.24 = internal constant [6 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6] // CHECK:STDOUT: // CHECK:STDOUT: declare void @_CG.Main(i32) // CHECK:STDOUT: @@ -39,14 +40,14 @@ fn F() { // CHECK:STDOUT: %.loc16_43.13.array.index = getelementptr inbounds [6 x i32], ptr %.loc16_43.3.temp, i32 0, i64 3, !dbg !7 // CHECK:STDOUT: %.loc16_43.16.array.index = getelementptr inbounds [6 x i32], ptr %.loc16_43.3.temp, i32 0, i64 4, !dbg !7 // CHECK:STDOUT: %.loc16_43.19.array.index = getelementptr inbounds [6 x i32], ptr %.loc16_43.3.temp, i32 0, i64 5, !dbg !7 -// CHECK:STDOUT: %array_type.as.Iterate.impl.NewCursor.call = call i32 @"_CNewCursor.7711e6f0e1563534:Iterate.Core.355bb079bb00aa16"(ptr @array), !dbg !8 +// CHECK:STDOUT: %array_type.as.Iterate.impl.NewCursor.call = call i32 @"_CNewCursor.7711e6f0e1563534:Iterate.Core.355bb079bb00aa16"(ptr @array.loc16_43.24), !dbg !8 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %var), !dbg !8 // CHECK:STDOUT: store i32 %array_type.as.Iterate.impl.NewCursor.call, ptr %var, align 4, !dbg !8 // CHECK:STDOUT: br label %for.next, !dbg !8 // CHECK:STDOUT: // CHECK:STDOUT: for.next: ; preds = %for.body, %entry // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc17_19.1.temp), !dbg !8 -// CHECK:STDOUT: call void @"_CNext.7711e6f0e1563534:Iterate.Core.355bb079bb00aa16"(ptr %.loc17_19.1.temp, ptr @array, ptr %var), !dbg !8 +// CHECK:STDOUT: call void @"_CNext.7711e6f0e1563534:Iterate.Core.355bb079bb00aa16"(ptr %.loc17_19.1.temp, ptr @array.loc16_43.24, ptr %var), !dbg !8 // CHECK:STDOUT: %Optional.HasValue.call = call i1 @_CHasValue.Optional.Core.b5e6acce74484d77(ptr %.loc17_19.1.temp), !dbg !8 // CHECK:STDOUT: br i1 %Optional.HasValue.call, label %for.body, label %for.done, !dbg !8 // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/builtins/cpp.carbon b/toolchain/lower/testdata/builtins/cpp.carbon index 89da299bfdd3..31791bec4435 100644 --- a/toolchain/lower/testdata/builtins/cpp.carbon +++ b/toolchain/lower/testdata/builtins/cpp.carbon @@ -45,6 +45,7 @@ fn Test() { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: @array = internal constant [4 x i32] [i32 1, i32 2, i32 3, i32 4] +// CHECK:STDOUT: @array.loc25_52.18 = internal constant [4 x i32] [i32 1, i32 2, i32 3, i32 4] // CHECK:STDOUT: // CHECK:STDOUT: declare void @_CTakePointerPointer.Main(ptr) // CHECK:STDOUT: @@ -64,9 +65,9 @@ fn Test() { // CHECK:STDOUT: %.loc25_52.10.array.index = getelementptr inbounds [4 x i32], ptr %.loc25_52.3.temp, i32 0, i64 2, !dbg !15 // CHECK:STDOUT: %.loc25_52.13.array.index = getelementptr inbounds [4 x i32], ptr %.loc25_52.3.temp, i32 0, i64 3, !dbg !15 // CHECK:STDOUT: %MakePointerPointer.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %.loc25_53.1.temp, i32 0, i32 0, !dbg !14 -// CHECK:STDOUT: store ptr @array, ptr %MakePointerPointer.call.init_list.begin, align 8, !dbg !14 +// CHECK:STDOUT: store ptr @array.loc25_52.18, ptr %MakePointerPointer.call.init_list.begin, align 8, !dbg !14 // CHECK:STDOUT: %MakePointerPointer.call.init_list.end = getelementptr inbounds nuw [16 x i8], ptr %.loc25_53.1.temp, i32 0, i32 8, !dbg !14 -// CHECK:STDOUT: store ptr getelementptr inbounds ([4 x i32], ptr @array, i32 1), ptr %MakePointerPointer.call.init_list.end, align 8, !dbg !14 +// CHECK:STDOUT: store ptr getelementptr inbounds ([4 x i32], ptr @array.loc25_52.18, i32 1), ptr %MakePointerPointer.call.init_list.end, align 8, !dbg !14 // CHECK:STDOUT: call void @_CTakePointerPointer.Main(ptr %.loc25_53.1.temp), !dbg !18 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc26_47.1.temp), !dbg !16 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc26_46.3.temp), !dbg !17 @@ -75,7 +76,7 @@ fn Test() { // CHECK:STDOUT: %.loc26_46.10.array.index = getelementptr inbounds [4 x i32], ptr %.loc26_46.3.temp, i32 0, i64 2, !dbg !17 // CHECK:STDOUT: %.loc26_46.13.array.index = getelementptr inbounds [4 x i32], ptr %.loc26_46.3.temp, i32 0, i64 3, !dbg !17 // CHECK:STDOUT: %MakePointerSize.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %.loc26_47.1.temp, i32 0, i32 0, !dbg !16 -// CHECK:STDOUT: store ptr @array, ptr %MakePointerSize.call.init_list.begin, align 8, !dbg !16 +// CHECK:STDOUT: store ptr @array.loc25_52.18, ptr %MakePointerSize.call.init_list.begin, align 8, !dbg !16 // CHECK:STDOUT: %MakePointerSize.call.init_list.size = getelementptr inbounds nuw [16 x i8], ptr %.loc26_47.1.temp, i32 0, i32 8, !dbg !16 // CHECK:STDOUT: store i64 4, ptr %MakePointerSize.call.init_list.size, align 8, !dbg !16 // CHECK:STDOUT: call void @_CTakePointerSize.Main(ptr %.loc26_47.1.temp), !dbg !19 diff --git a/toolchain/lower/testdata/function/definition/destroy.carbon b/toolchain/lower/testdata/function/definition/destroy.carbon index e6498d7aa681..d31d6465f7dc 100644 --- a/toolchain/lower/testdata/function/definition/destroy.carbon +++ b/toolchain/lower/testdata/function/definition/destroy.carbon @@ -76,6 +76,7 @@ fn InitLet() { // CHECK:STDOUT: source_filename = "let_param.carbon" // CHECK:STDOUT: // CHECK:STDOUT: @C.val = internal constant {} zeroinitializer +// CHECK:STDOUT: @C.val.loc12_6.6 = internal constant {} zeroinitializer // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind // CHECK:STDOUT: define void @_CF.Main(ptr %_) #0 !dbg !4 { @@ -90,7 +91,7 @@ fn InitLet() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc12_6.2.temp = alloca {}, align 8, !dbg !14 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_6.2.temp), !dbg !14 -// CHECK:STDOUT: call void @_CF.Main(ptr @C.val), !dbg !15 +// CHECK:STDOUT: call void @_CF.Main(ptr @C.val.loc12_6.6), !dbg !15 // CHECK:STDOUT: call void @_CG.Main(), !dbg !16 // CHECK:STDOUT: ret void, !dbg !17 // CHECK:STDOUT: } diff --git a/toolchain/lower/testdata/function/definition/var_param.carbon b/toolchain/lower/testdata/function/definition/var_param.carbon index 6f21f151e6c7..0b20dc392560 100644 --- a/toolchain/lower/testdata/function/definition/var_param.carbon +++ b/toolchain/lower/testdata/function/definition/var_param.carbon @@ -33,6 +33,7 @@ fn Call() { // CHECK:STDOUT: // CHECK:STDOUT: @int_1.5d2 = internal constant i32 1 // CHECK:STDOUT: @X.val = internal constant {} zeroinitializer +// CHECK:STDOUT: @X.val.loc27_18.6 = internal constant {} zeroinitializer // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind // CHECK:STDOUT: define void @_COneVar_i32.Main(ptr %_) #0 !dbg !4 { @@ -83,7 +84,7 @@ fn Call() { // CHECK:STDOUT: call void @_CTwoVars.Main(ptr @int_1.5d2, ptr @X.val), !dbg !47 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_15.1.temp), !dbg !42 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc27_18.2.temp), !dbg !43 -// CHECK:STDOUT: call void @_CVarThenLet.Main(ptr @int_1.5d2, ptr @X.val), !dbg !48 +// CHECK:STDOUT: call void @_CVarThenLet.Main(ptr @int_1.5d2, ptr @X.val.loc27_18.6), !dbg !48 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc21_23.1.temp), !dbg !44 // CHECK:STDOUT: call void @_CLetThenVar.Main(i32 1, ptr @X.val), !dbg !49 // CHECK:STDOUT: ret void, !dbg !50 diff --git a/toolchain/lower/testdata/interop/cpp/reference.carbon b/toolchain/lower/testdata/interop/cpp/reference.carbon index d6acd95c87b8..d06d481eb34a 100644 --- a/toolchain/lower/testdata/interop/cpp/reference.carbon +++ b/toolchain/lower/testdata/interop/cpp/reference.carbon @@ -135,6 +135,7 @@ fn GetRefs() { // CHECK:STDOUT: // CHECK:STDOUT: @C.val = internal constant {} zeroinitializer // CHECK:STDOUT: @int_42.c68 = internal constant i32 42 +// CHECK:STDOUT: @C.val.loc19_20.3 = internal constant {} zeroinitializer // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable // CHECK:STDOUT: define dso_local void @_ZN1CC1Ev.carbon_thunk(ptr noundef %return) #0 { @@ -205,7 +206,7 @@ fn GetRefs() { // CHECK:STDOUT: call void @"_COp.9b0a46309e124f8a:DefaultOrUnformed.Core.93349b0fe912a29b"(ptr %c.var), !dbg !19 // CHECK:STDOUT: call void @_Z8TakeCRefR1C(ptr %c.var), !dbg !24 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc19_18.2.temp), !dbg !20 -// CHECK:STDOUT: call void @_Z9TakeCRRefO1C.carbon_thunk(ptr @C.val), !dbg !25 +// CHECK:STDOUT: call void @_Z9TakeCRRefO1C.carbon_thunk(ptr @C.val.loc19_20.3), !dbg !25 // CHECK:STDOUT: call void @_Z13TakeConstCRefRK1C.carbon_thunk(ptr %c.var), !dbg !26 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n.var), !dbg !21 // CHECK:STDOUT: store i32 poison, ptr %n.var, align 4, !dbg !21 @@ -302,6 +303,7 @@ fn GetRefs() { // CHECK:STDOUT: // CHECK:STDOUT: @C.val = internal constant {} zeroinitializer // CHECK:STDOUT: @int_42.c68 = internal constant i32 42 +// CHECK:STDOUT: @C.val.loc20_20.3 = internal constant {} zeroinitializer // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable // CHECK:STDOUT: define dso_local void @_ZN1CC1Ev.carbon_thunk(ptr noundef %return) #0 { @@ -402,7 +404,7 @@ fn GetRefs() { // CHECK:STDOUT: call void @"_COp.9b0a46309e124f8a:DefaultOrUnformed.Core.93349b0fe912a29b"(ptr %c.var), !dbg !21 // CHECK:STDOUT: call void @_Z8TakeCRefR1C10ForceThunk.carbon_thunk1(ptr %c.var), !dbg !26 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_18.2.temp), !dbg !22 -// CHECK:STDOUT: call void @_Z9TakeCRRefRK1C10ForceThunk.carbon_thunk1(ptr @C.val), !dbg !27 +// CHECK:STDOUT: call void @_Z9TakeCRRefRK1C10ForceThunk.carbon_thunk1(ptr @C.val.loc20_20.3), !dbg !27 // CHECK:STDOUT: call void @_Z13TakeConstCRefRK1C10ForceThunk.carbon_thunk1(ptr %c.var), !dbg !28 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n.var), !dbg !23 // CHECK:STDOUT: store i32 poison, ptr %n.var, align 4, !dbg !23 diff --git a/toolchain/lower/testdata/interop/cpp/std_initializer_list.carbon b/toolchain/lower/testdata/interop/cpp/std_initializer_list.carbon index f77de38d1987..23500517ed2c 100644 --- a/toolchain/lower/testdata/interop/cpp/std_initializer_list.carbon +++ b/toolchain/lower/testdata/interop/cpp/std_initializer_list.carbon @@ -125,6 +125,7 @@ fn InitNontrivialDtor() { // CHECK:STDOUT: $_ZN11vector_likeD2Ev = comdat any // CHECK:STDOUT: // CHECK:STDOUT: @array = internal constant [3 x i32] [i32 1, i32 2, i32 3] +// CHECK:STDOUT: @array.loc13_50.15 = internal constant [3 x i32] [i32 1, i32 2, i32 3] // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define dso_local void @_ZN11vector_likeC1ESt16initializer_listIiE.carbon_thunk(ptr noundef %list, ptr noundef %return) #0 { @@ -194,9 +195,9 @@ fn InitNontrivialDtor() { // CHECK:STDOUT: %.loc13_50.7.array.index = getelementptr inbounds [3 x i32], ptr %.loc13_50.3.temp, i32 0, i64 1, !dbg !25 // CHECK:STDOUT: %.loc13_50.10.array.index = getelementptr inbounds [3 x i32], ptr %.loc13_50.3.temp, i32 0, i64 2, !dbg !25 // CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 0, !dbg !24 -// CHECK:STDOUT: store ptr @array, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !24 +// CHECK:STDOUT: store ptr @array.loc13_50.15, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !24 // CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.end = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 8, !dbg !24 -// CHECK:STDOUT: store ptr getelementptr inbounds ([3 x i32], ptr @array, i32 1), ptr %initializer_list.initializer_list.call.init_list.end, align 8, !dbg !24 +// CHECK:STDOUT: store ptr getelementptr inbounds ([3 x i32], ptr @array.loc13_50.15, i32 1), ptr %initializer_list.initializer_list.call.init_list.end, align 8, !dbg !24 // CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !26 // CHECK:STDOUT: ret void, !dbg !27 // CHECK:STDOUT: } @@ -214,9 +215,9 @@ fn InitNontrivialDtor() { // CHECK:STDOUT: %.loc18_36.8.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.4.temp, i32 0, i64 1, !dbg !30 // CHECK:STDOUT: %.loc18_36.11.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.4.temp, i32 0, i64 2, !dbg !30 // CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %.loc18_36.2.temp, i32 0, i32 0, !dbg !30 -// CHECK:STDOUT: store ptr @array, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !30 +// CHECK:STDOUT: store ptr @array.loc13_50.15, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !30 // CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.end = getelementptr inbounds nuw [16 x i8], ptr %.loc18_36.2.temp, i32 0, i32 8, !dbg !30 -// CHECK:STDOUT: store ptr getelementptr inbounds ([3 x i32], ptr @array, i32 1), ptr %initializer_list.initializer_list.call.init_list.end, align 8, !dbg !30 +// CHECK:STDOUT: store ptr getelementptr inbounds ([3 x i32], ptr @array.loc13_50.15, i32 1), ptr %initializer_list.initializer_list.call.init_list.end, align 8, !dbg !30 // CHECK:STDOUT: call void @_ZN11vector_likeC1ESt16initializer_listIiE.carbon_thunk(ptr %.loc18_36.2.temp, ptr %_.var), !dbg !29 // CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !31 // CHECK:STDOUT: call void @_ZN11vector_likeD2Ev(ptr %_.var), !dbg !29 @@ -322,6 +323,7 @@ fn InitNontrivialDtor() { // CHECK:STDOUT: $_ZN11vector_likeD2Ev = comdat any // CHECK:STDOUT: // CHECK:STDOUT: @array = internal constant [3 x i32] [i32 1, i32 2, i32 3] +// CHECK:STDOUT: @array.loc13_50.15 = internal constant [3 x i32] [i32 1, i32 2, i32 3] // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define dso_local void @_ZN11vector_likeC1ESt16initializer_listIiE.carbon_thunk(ptr noundef %list, ptr noundef %return) #0 { @@ -391,7 +393,7 @@ fn InitNontrivialDtor() { // CHECK:STDOUT: %.loc13_50.7.array.index = getelementptr inbounds [3 x i32], ptr %.loc13_50.3.temp, i32 0, i64 1, !dbg !27 // CHECK:STDOUT: %.loc13_50.10.array.index = getelementptr inbounds [3 x i32], ptr %.loc13_50.3.temp, i32 0, i64 2, !dbg !27 // CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 0, !dbg !26 -// CHECK:STDOUT: store ptr @array, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !26 +// CHECK:STDOUT: store ptr @array.loc13_50.15, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !26 // CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.size = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 8, !dbg !26 // CHECK:STDOUT: store i64 3, ptr %initializer_list.initializer_list.call.init_list.size, align 8, !dbg !26 // CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !28 @@ -411,7 +413,7 @@ fn InitNontrivialDtor() { // CHECK:STDOUT: %.loc18_36.8.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.4.temp, i32 0, i64 1, !dbg !32 // CHECK:STDOUT: %.loc18_36.11.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.4.temp, i32 0, i64 2, !dbg !32 // CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %.loc18_36.2.temp, i32 0, i32 0, !dbg !32 -// CHECK:STDOUT: store ptr @array, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !32 +// CHECK:STDOUT: store ptr @array.loc13_50.15, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !32 // CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.size = getelementptr inbounds nuw [16 x i8], ptr %.loc18_36.2.temp, i32 0, i32 8, !dbg !32 // CHECK:STDOUT: store i64 3, ptr %initializer_list.initializer_list.call.init_list.size, align 8, !dbg !32 // CHECK:STDOUT: call void @_ZN11vector_likeC1ESt16initializer_listIiE.carbon_thunk(ptr %.loc18_36.2.temp, ptr %_.var), !dbg !31 diff --git a/toolchain/lower/testdata/interop/cpp/template.carbon b/toolchain/lower/testdata/interop/cpp/template.carbon index b3d713db6e64..e3c12f67cc3a 100644 --- a/toolchain/lower/testdata/interop/cpp/template.carbon +++ b/toolchain/lower/testdata/interop/cpp/template.carbon @@ -264,6 +264,7 @@ fn Call3() { // CHECK:STDOUT: %class.X = type { i8 } // CHECK:STDOUT: // CHECK:STDOUT: @X.val = internal constant {} zeroinitializer +// CHECK:STDOUT: @X.val.loc12_14.3 = internal constant {} zeroinitializer // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define dso_local void @_Z3fooIJEEv1XDpT_.carbon_thunk(ptr noundef %0) #0 { @@ -318,7 +319,7 @@ fn Call3() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc12_12.2.temp = alloca {}, align 8, !dbg !17 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_12.2.temp), !dbg !17 -// CHECK:STDOUT: call void @_Z3fooIJEEv1XDpT_.carbon_thunk(ptr @X.val), !dbg !18 +// CHECK:STDOUT: call void @_Z3fooIJEEv1XDpT_.carbon_thunk(ptr @X.val.loc12_14.3), !dbg !18 // CHECK:STDOUT: ret void, !dbg !19 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -327,7 +328,7 @@ fn Call3() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc18_12.2.temp = alloca {}, align 8, !dbg !21 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_12.2.temp), !dbg !21 -// CHECK:STDOUT: call void @_Z3fooIJiEEv1XDpT_.carbon_thunk(ptr @X.val, i32 2), !dbg !22 +// CHECK:STDOUT: call void @_Z3fooIJiEEv1XDpT_.carbon_thunk(ptr @X.val.loc12_14.3, i32 2), !dbg !22 // CHECK:STDOUT: ret void, !dbg !23 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -336,7 +337,7 @@ fn Call3() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc24_12.2.temp = alloca {}, align 8, !dbg !25 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc24_12.2.temp), !dbg !25 -// CHECK:STDOUT: call void @_Z3fooIJiiEEv1XDpT_.carbon_thunk(ptr @X.val, i32 2, i32 3), !dbg !26 +// CHECK:STDOUT: call void @_Z3fooIJiiEEv1XDpT_.carbon_thunk(ptr @X.val.loc12_14.3, i32 2, i32 3), !dbg !26 // CHECK:STDOUT: ret void, !dbg !27 // CHECK:STDOUT: } // CHECK:STDOUT: